Exception: Freddy::ErrorResponse

Inherits:
StandardError
  • Object
show all
Defined in:
lib/freddy/error_response.rb

Direct Known Subclasses

InvalidRequestError, TimeoutError

Constant Summary collapse

DEFAULT_ERROR_MESSAGE =
'Use #response to get the error response'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.



7
8
9
10
# File 'lib/freddy/error_response.rb', line 7

def initialize(response)
  @response = response
  super(format_message(response) || DEFAULT_ERROR_MESSAGE)
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/freddy/error_response.rb', line 5

def response
  @response
end