Exception: Alchemrest::ServerError
- Inherits:
-
ResponseError
- Object
- StandardError
- Error
- ResponseError
- Alchemrest::ServerError
- Defined in:
- lib/alchemrest/error.rb
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
Returns the value of attribute cause.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, cause = nil) ⇒ ServerError
constructor
A new instance of ServerError.
- #to_s ⇒ Object
Methods inherited from ResponseError
#deconstruct, #deconstruct_keys
Methods inherited from Error
#deconstruct, #deconstruct_keys
Constructor Details
#initialize(response, cause = nil) ⇒ ServerError
Returns a new instance of ServerError.
43 44 45 46 47 |
# File 'lib/alchemrest/error.rb', line 43 def initialize(response, cause = nil) @response = response @cause = cause super(response) end |
Instance Attribute Details
#cause ⇒ Object (readonly)
Returns the value of attribute cause.
41 42 43 |
# File 'lib/alchemrest/error.rb', line 41 def cause @cause end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
41 42 43 |
# File 'lib/alchemrest/error.rb', line 41 def response @response end |
Instance Method Details
#to_s ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/alchemrest/error.rb', line 49 def to_s if response.circuit_open? "CIRCUIT OPEN" elsif response.timeout? "#{response.status} timeout" else end end |