-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow empty 'error' to be in repsonse. #2
Conversation
This was needed to call functions of trac JSON-RPC API. |
This should really be fixed on the trac side. Per the JSON-RPC Response specifications, the Alternatively, we could add hooks for downstream libs to register a callback and massage the data before passing it to parse_response to account for non-conforming servers. I imagine it's easiest to just fix the problem at the source though. |
I'm afraid trac uses JSON-RPC 1.0, where specifications says, "error - An Error object if there was an error invoking the method. It must be null if there was no error.". This pull request allows jsonrpc-base to work with both JSON-RPC 1.0 and 2.0. |
Ah, I see. I that case, my small preference would be call it out explicitly, instead of relying on it being falsey just to be extra safe. ( It should be sufficient to copy the block below, and test with a response that includes |
Reason: some servers send `'error': None`.
241cf0e
to
6fdcde9
Compare
OK, I did that. Also had to fix |
Thanks for the contribution! 🌟 |
I'll get new versions pushed out later today. |
Reason: some servers send
'error': None
.