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