Skip to content

Commit

Permalink
Add error classes for new Twitter API v1.1 response codes
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Sep 7, 2012
1 parent 03a401f commit 154b00f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/twitter/error/gateway_timeout.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'twitter/error/server_error'

module Twitter
class Error
# Raised when Twitter returns the HTTP status code 504
class GatewayTimeout < Twitter::Error::ServerError
HTTP_STATUS_CODE = 504
MESSAGE = "The Twitter servers are up, but the request couldn't be serviced due to some failure within our stack. Try again later."
end
end
end
10 changes: 10 additions & 0 deletions lib/twitter/error/rate_limited.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'twitter/error/client_error'

module Twitter
class Error
# Raised when Twitter returns the HTTP status code 429
class RateLimited < Twitter::Error::ClientError
HTTP_STATUS_CODE = 429
end
end
end

0 comments on commit 154b00f

Please sign in to comment.