Exception: Eson::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/eson/error.rb

Overview

Special error class for errors happening in the Eson context. In contrast to StandardErrors, this error also holds the response associated with this Error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, response) ⇒ Error

Returns a new instance of Error.

Parameters:

  • msg (String)

    The error message

  • response (Object)

    The raw response object.



11
12
13
14
15
# File 'lib/eson/error.rb', line 11

def initialize(msg, response)
  super(response.body)
  
  self.response = response
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



6
7
8
# File 'lib/eson/error.rb', line 6

def response
  @response
end