Exception: ExperianConsumerView::Errors::ApiHttpError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/experian_consumer_view/errors.rb

Overview

Base helper class for errors caused due to unexpected HTTP responses

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, response) ⇒ ApiHttpError

Returns a new instance of ApiHttpError.



9
10
11
12
13
# File 'lib/experian_consumer_view/errors.rb', line 9

def initialize(code, response)
  super()
  @code = code
  @response = response
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



7
8
9
# File 'lib/experian_consumer_view/errors.rb', line 7

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



7
8
9
# File 'lib/experian_consumer_view/errors.rb', line 7

def response
  @response
end

Instance Method Details

#messageObject



15
16
17
# File 'lib/experian_consumer_view/errors.rb', line 15

def message
  "HTTP code [#{@code}], response text [#{@response}]"
end