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

JSONDecodeError while parsing error messages #16

Open
janek-cosmose opened this issue Feb 13, 2024 · 0 comments · May be fixed by #17
Open

JSONDecodeError while parsing error messages #16

janek-cosmose opened this issue Feb 13, 2024 · 0 comments · May be fixed by #17

Comments

@janek-cosmose
Copy link

An example of an actual error field of an RPC response:

{"name": "HANDLER_ERROR", "cause": {"info": {}, "name": "INVALID_TRANSACTION"}, "code": -32000, "message": "Server error", "data": {"TxExecutionError": {"InvalidTxError": "Expired"}}}

When fed into JsonProvider.get_error_from_response it raises an exception:

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The correct behavior would be to return an instance of py_near.exceptions.provider.Expired.

janek-cosmose added a commit to janek-cosmose/py-near that referenced this issue Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant