Exception: Aptible::BillForward::ResponseError
- Defined in:
- lib/aptible/billforward/exceptions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#response ⇒ Object
Returns the value of attribute response.
Attributes inherited from Exception
Instance Method Summary collapse
-
#initialize(message, attrs = {}) ⇒ ResponseError
constructor
A new instance of ResponseError.
Constructor Details
#initialize(message, attrs = {}) ⇒ ResponseError
Returns a new instance of ResponseError.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/aptible/billforward/exceptions.rb', line 16 def initialize(, attrs = {}) self.response = attrs[:response] self.body = attrs[:body] if body.present? && body.key?(:errorMessage) error = body[:errorMessage] = "#{message} (#{error})" elsif response = "#{message} (\"#{response.inspect}\")" end super(, attrs) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
14 15 16 |
# File 'lib/aptible/billforward/exceptions.rb', line 14 def body @body end |
#response ⇒ Object
Returns the value of attribute response.
13 14 15 |
# File 'lib/aptible/billforward/exceptions.rb', line 13 def response @response end |