Exception: Twitter::Error::ServerError
- Inherits:
-
Twitter::Error
- Object
- StandardError
- Twitter::Error
- Twitter::Error::ServerError
- Defined in:
- lib/twitter/error/server_error.rb
Overview
Raised when Twitter returns a 5xx HTTP status code
Direct Known Subclasses
BadGateway, GatewayTimeout, InternalServerError, ServiceUnavailable
Constant Summary
- MESSAGE =
"Server Error"
Constants inherited from Twitter::Error
Instance Attribute Summary
Attributes inherited from Twitter::Error
#rate_limit, #wrapped_exception
Class Method Summary (collapse)
-
+ (Twitter::Error) from_response(response = {})
Create a new error from an HTTP environment.
Instance Method Summary (collapse)
-
- (Twitter::Error::ServerError) initialize(message = nil, response_headers = {})
constructor
Initializes a new ServerError object.
Methods inherited from Twitter::Error
#backtrace, descendants, errors
Constructor Details
- (Twitter::Error::ServerError) initialize(message = nil, response_headers = {})
Initializes a new ServerError object
22 23 24 |
# File 'lib/twitter/error/server_error.rb', line 22 def initialize(=nil, response_headers={}) super(( || self.class.const_get(:MESSAGE)), response_headers) end |
Class Method Details
+ (Twitter::Error) from_response(response = {})
Create a new error from an HTTP environment
13 14 15 |
# File 'lib/twitter/error/server_error.rb', line 13 def self.from_response(response={}) new(nil, response[:response_headers]) end |