Needs work
Project:
JSONRPC Server
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Apr 2010 at 18:09 UTC
Updated:
19 Nov 2010 at 18:13 UTC
Jump to comment: Most recent file
Comments
Comment #1
mmilo commentedAnyhow, here's my patch.
- Allows for a custom error code to be returned
- I moved the
"name" => 'JSONRPCError'property of the error object to only apply for JSON-RPC 1.1, since it's not required in the 2.0 spec anymore.Comment #2
mmilo commentedWhoops.
Comment #3
mmilo commentedIncluded a small change so that error() invokes hook_server_error.
Comment #4
mmilo commentedRe-attaching.
Comment #5
gnugu commentedI second that.
I have arrived to the same solution as mmilo. Wanted to post the patch, but it's not needed now :).
Can this be incorporated in the server?
Comment #6
voxpelli commentedIs custom error codes in compliance with the specification? If not - then this shouldn't be committed unless someone has a very good reason to not follow the specification.
Also: There are a couple of formatting error in the latest patch - use spaces, not tabs. Also - why the switch when there's only one case?
Finally: No review status on this even though it has patches? It should have :) But since there are a few things that should be fixed in the patch I'm moving this to "needs work" instead.
Comment #7
mmilo commentedRerolled.
Yes, the specification allows for custom error codes. There are error codes reserved for pre-defined errors in the spec - and it's only these error codes the module is currently using.
See http://groups.google.com/group/json-rpc/web/json-rpc-2-0?pli=1.
There's a switch being used only for one case because it's done like that throughout the module, and just in case there is a major version change.