-
-
Notifications
You must be signed in to change notification settings - Fork 232
RPC Service: Improve error handling for HTTP status codes #5844
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
Open
Labels
Comments
4 tasks
cryptodev-2s
added a commit
that referenced
this issue
May 23, 2025
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> Improves error handling in the RPC service by making it more specific and consistent. The changes include: - Clarifies error handling for different HTTP status codes: - 401: Unauthorized error - 402/404/5xx: Resource unavailable error - 405/501: Method not found error - 429: Rate limiting error - Other 4xx: Invalid request error - Invalid JSON: Parse error ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> Fixes #5844 ## Changelog <!-- THIS SECTION IS NO LONGER NEEDED. The process for updating changelogs has changed. Please consult the "Updating changelogs" section of the Contributing doc for more. --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
We reverted the above PR as we need to verify with the Wallet API team that these changes don't cause any issues with dapps before merging it. |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
The RPC service currently has inconsistent error handling for different HTTP status codes. Some status codes are handled with generic errors, making it difficult to:
Proposed Solution
Improve error handling by implementing specific error types for different HTTP status codes:
Benefits
Testing
The text was updated successfully, but these errors were encountered: