Skip to content

Commit

Permalink
Add Twitter::Error::UnprocessableEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 4, 2012
1 parent 7cda739 commit 608da7a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -136,10 +136,11 @@ removed.

### Errors

It's worth mentioning two new error classes:
It's worth mentioning new error classes:

* `Twitter::Error::GatewayTimeout`
* `Twitter::Error::RateLimited`
* `Twitter::Error::UnprocessableEntity`

In previous versions of this library, rate limit errors were indicated by
raising either `Twitter::Error::BadRequest` or
Expand Down
10 changes: 10 additions & 0 deletions lib/twitter/error/unprocessable_entity.rb
@@ -0,0 +1,10 @@
require 'twitter/error/client_error'

module Twitter
class Error
# Raised when Twitter returns the HTTP status code 404
class UnprocessableEntity < Twitter::Error::ClientError
HTTP_STATUS_CODE = 422
end
end
end
1 change: 1 addition & 0 deletions lib/twitter/response/raise_error.rb
Expand Up @@ -9,6 +9,7 @@
require 'twitter/error/rate_limited'
require 'twitter/error/service_unavailable'
require 'twitter/error/unauthorized'
require 'twitter/error/unprocessable_entity'

module Twitter
module Response
Expand Down

0 comments on commit 608da7a

Please sign in to comment.