Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
atifaziz opened this issue Aug 25, 2015 · 6 comments
Open

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

atifaziz opened this issue Aug 25, 2015 · 6 comments

Comments

@atifaziz
Copy link
Owner

Originally reported on Google Code with ID 56

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. 

Reported by jeamfry on 2014-05-20 04:23:07

@atifaziz
Copy link
Owner Author

Reported by azizatif on 2014-05-26 18:55:03

  • Status changed: Accepted
  • Labels added: Priority-Low, Component-JSON-RPC
  • Labels removed: Priority-Medium

@atifaziz
Copy link
Owner Author

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

Reported by RolfanRagnorak on 2015-01-29 16:31:13


- _Attachment: [jayrock_76_to_77.diff](https://storage.googleapis.com/google-code-attachments/jayrock/issue-56/comment-2/jayrock_76_to_77.diff)_

@atifaziz
Copy link
Owner Author

Uhm, dude? what's up with this?

Reported by RolfanRagnorak on 2015-05-26 13:29:20

@atifaziz
Copy link
Owner Author

@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

Reported by azizatif on 2015-05-26 16:50:36

@atifaziz
Copy link
Owner Author

@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.

Reported by azizatif on 2015-05-28 07:11:09

@rjune
Copy link

rjune commented Nov 18, 2015

You are correct, my patches thus far have been on the client side. I don't use Jayrock for the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants