Repository navigation
Fix reconstructed JSON RPC error responses - #120
Open
bensynapse wants to merge 1 commit into
Open
bensynapse wants to merge 1 commit into
bensynapse wants to merge 1 commit into
Conversation
Read the message from the dictionary input and expose the error code used by response creation and dispatcher forwarding. Keep the existing private attribute for callers that already inspect it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I run Live Tennis API.
Addresses #116.
JSONRPCError.error_respond()raises AttributeError because the constructor only sets_jsonrpc_error_code. Dictionary input also fails because it readserror.message.The constructor now reads the dictionary message and exposes
jsonrpc_error_code, while retaining the private attribute. Reconstructed errors can serialize again. A remote error forwarded through RPCClient and RPCDispatcher keeps its original code and structured data.All 13 new cases fail before the fix. They cover both constructor inputs, empty messages, absent and explicit data, both protocol error modes, and dispatcher forwarding.
tox -e pypasses in Docker on Python 3.10.22: 655 passed and 55 existing skips, including the coverage run. Both pytest commands from tox.ini also pass on Python 3.9.25. Source and wheel builds pass withpython -m build --no-isolation.The pinned gevent needs pkg_resources, so I installed
setuptools<81in the test environment. Without it, tox reports 15 WSGI fixture setup errors. Repository dependency pins are unchanged.