Exception: ServiceError

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

Overview

API Response Error Class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, message = "Service responded with an error") ⇒ ServiceError

Returns a new instance of ServiceError.



6
7
8
9
10
# File 'lib/service_error.rb', line 6

def initialize(response, message = "Service responded with an error")
  super(message)
  @code = response.code
  @response = response
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



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

def response
  @response
end