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

Add more expressive exceptions hierarchy #5

Closed
mbbx6spp opened this issue Oct 18, 2010 · 1 comment
Closed

Add more expressive exceptions hierarchy #5

mbbx6spp opened this issue Oct 18, 2010 · 1 comment

Comments

@mbbx6spp
Copy link
Member

Currently a Twitter::RESTError is raised when any type of error occurs on the REST API side. While it contains the status code inside the RuntimeError object subclass, it would be easier to discriminate with different rescue blocks based on the type of RESTError is raised by the Twitter.com API.

Types of errors to be modelled:

  • 304 - Not modified, i.e. no new results since last query.
  • 400 - Bad Request, i.e. reached rate limit.
  • 401 - Unauthorized, i.e. missing or incorrect credentials
  • 403 - Forbidden, i.e. reached update limits
  • 404 - Resource Not Found, i.e. the user, tweet, etc that was being accessed does not exist.
  • 406 - Not Acceptable, i.e. format specified in request is not understood.
  • 420 - Search Rate Limit Reached, i.e. on the search API 420s are returned to notify client that they are being rate limited and they should abide by Retry-After header.
  • 500 - Internal Server Error, i.e. Twitter.com API is borked - post error messages to the relevant Google Group for the Twitter.com API.
  • 502 - Bad Gateway, i.e. the Twitter.com servers are being upgraded.
  • 503 - Service Unavailable, i.e. Twitter.com servers can't handle all requests currently.
@mbbx6spp
Copy link
Member Author

Added this new runtime error class hierarchy in 4fde90a

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant