reserve64 / jayrock

Automatically exported from code.google.com/p/jayrock
GNU General Public License v3.0
0 stars 1 forks source link

Make Jayrock meet the error requirements of JSON-RPC 2.0 #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Given that JSON-RPC does not define the error object, but JSON-RPC 2.0 does, it 
would be nice or interesting to encapsulate all exceptions thrown by an 
application with a custom exception, as to make the JsonRpcError class return a 
correct JSON-RPC 2.0 error object.

e.g. as for now Jayrock returns an object like { "name", "error", "errors" } 
whilst JSON-RPC 2.0 specification defines the error object as { "code", 
"message", "data" }. I have edited somewhat the code of the application, and 
found that you can perfectly define custom Exceptions with a code (and still 
treat basic Exceptions with a custom "unknown Exception" code). This way you 
can offer a JsonException class to the user, which could be inherited and the 
error code changed or something.

I marked this as an enhancement because the current error object meets JSON-RPC 
1.0 requirements. 

Original issue reported on code.google.com by jeam...@gmail.com on 20 May 2014 at 4:23

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 26 May 2014 at 6:55

GoogleCodeExporter commented 9 years ago
Here's an initial patch to resolve this issue. Please review it and make sure 
its good for inclusion

Original comment by RolfanRa...@gmail.com on 29 Jan 2015 at 4:31

Attachments:

GoogleCodeExporter commented 9 years ago
Uhm, dude? what's up with this?

Original comment by RolfanRa...@gmail.com on 26 May 2015 at 1:29

GoogleCodeExporter commented 9 years ago
@RolfanRagnorak Since Google has been so kind to shut down their project 
hosting service[1] (instead of, say, just freezing it), I'm spending a lot time 
migrating my projects as opposed to making actual progress on them. That's 
what's up.

[1]: http://google-opensource.blogspot.ch/2015/03/farewell-to-google-code.html

Original comment by azizatif on 26 May 2015 at 4:50

GoogleCodeExporter commented 9 years ago
@RolfanRagnorak I finally got round to reviewing your patch. Seems to me that 
@jeamfry is looking for JSON-RPC 2.0 compliance on the server end for reported 
errors whereas your patch addresses the issue on the client side.

Original comment by azizatif on 28 May 2015 at 7:11