Method: Esi::ApiError#initialize

Defined in:
lib/esi.rb

#initialize(response, original_exception = nil) ⇒ ApiError

Returns a new instance of ApiError.



111
112
113
114
115
116
117
118
119
120
# File 'lib/esi.rb', line 111

def initialize(response, original_exception=nil)
  super(response.original_response)

  @response = response
  @original_exception = original_exception
  @code = response.original_response.status
  @key = response.data[:key]
  @message = response.data[:message].presence || response.data[:error] || original_exception.message
  @type = response.data[:exceptionType]
end