-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error classes for new Twitter API v1.1 response codes
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |