Exception: PaymentsApi::RequestErrorException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- PaymentsApi::RequestErrorException
- Defined in:
- lib/payments_api/exceptions/request_error_exception.rb
Overview
Format for 400 Errors
Instance Attribute Summary collapse
-
#message ⇒ String
Message indicating the source of the error in the request.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ RequestErrorException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
permalink #initialize(reason, response) ⇒ RequestErrorException
The constructor.
16 17 18 19 20 |
# File 'lib/payments_api/exceptions/request_error_exception.rb', line 16 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
permalink #message ⇒ String
Message indicating the source of the error in the request
11 12 13 |
# File 'lib/payments_api/exceptions/request_error_exception.rb', line 11 def @message end |
Instance Method Details
permalink #unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
25 26 27 |
# File 'lib/payments_api/exceptions/request_error_exception.rb', line 25 def unbox(hash) @message = hash['message'] end |