-
Notifications
You must be signed in to change notification settings - Fork 244
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
feat: handle MethodNotFound errors in JsonRpcProvider #1028
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good first step to reducing vagueness in these messages
Will keep an eye out for dev feedback on this going forward in NAJ and WS-JS
Add to CI as well if error_messsages.json is up to date according to |
I'm puzzled as to why tests fail now for |
The idea of having understandable error messages looks great to me and was implemented in #1275 based on the latest version of the library and without merge conflicts I'd suggest closing this one so we don't leave it out of date |
Closing as it's been resolved by #1275 |
Motivation
Currently
JsonRpcProvider
does not do any error parsing when the error message is on theresult
key (e.g.response.result
rather than the expectedresponse.error
). These raw errors are not intuitive to users.Description
This PR checks for string values of
result.error
on the RPC response and throws an exception if it matches a known pattern for an RPC error using the existinggetErrorTypeFromErrorMessage
method. This makes it more consistent with the error handling performed for structured errors.I don't currently know which other RPC endpoints return errors in this way but if it is possible to enumerate them we can ensure they have the same coverage here.
Before:
After:
Checklist