Skip to content

Instantly share code, notes, and snippets.

@cmthakur
Created August 7, 2012 14:57
Show Gist options
  • Save cmthakur/3286057 to your computer and use it in GitHub Desktop.
Save cmthakur/3286057 to your computer and use it in GitHub Desktop.
Rails http error
just one of the HTTP error response codes that Active Resource will handle with its own exception. The following HTTP response codes will also result in these exceptions:
200..399 - Valid response. No exceptions, other than these redirects:
301, 302, 303, 307 - ActiveResource::Redirection
400 - ActiveResource::BadRequest
401 - ActiveResource::UnauthorizedAccess
403 - ActiveResource::ForbiddenAccess
404 - ActiveResource::ResourceNotFound
405 - ActiveResource::MethodNotAllowed
409 - ActiveResource::ResourceConflict
410 - ActiveResource::ResourceGone
422 - ActiveResource::ResourceInvalid (rescued by save as validation errors)
401..499 - ActiveResource::ClientError
500..599 - ActiveResource::ServerError
Other - ActiveResource::ConnectionError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment