Skip to content

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
cryptodev-2s opened this issue May 21, 2025 · 0 comments · May be fixed by #5843
Open

RPC Service: Improve error handling for HTTP status codes #5844

cryptodev-2s opened this issue May 21, 2025 · 0 comments · May be fixed by #5843
Assignees

Comments

@cryptodev-2s
Copy link
Contributor

cryptodev-2s commented May 21, 2025

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:

  • Debug issues
  • Handle specific error cases in the application
  • Provide meaningful error messages to users

Proposed Solution

Improve error handling by implementing specific error types 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

Benefits

  • More predictable error handling
  • Better debugging capabilities
  • Clearer error messages for users
  • Consistent error data structure
  • Improved test coverage and documentation

Testing

  • Verify all HTTP status codes are handled correctly
  • Ensure error messages are consistent
  • Check that error data includes necessary information
  • Run existing test suite to confirm no regressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant