Exception: Buckaruby::ApiException
- Inherits:
-
BuckarooException
- Object
- StandardError
- BuckarooException
- Buckaruby::ApiException
- Defined in:
- lib/buckaruby/exception.rb
Overview
Exception raised when an API call to Buckaroo results in a “Fail”.
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(params = {}) ⇒ ApiException
constructor
A new instance of ApiException.
- #status_code ⇒ Object
- #status_message ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ ApiException
Returns a new instance of ApiException.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/buckaruby/exception.rb', line 12 def initialize(params = {}) @params = params = if && status_code "API request failed: #{} (#{status_code})" elsif "API request failed: #{}" else 'API request failed' end super() end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/buckaruby/exception.rb', line 10 def params @params end |
Instance Method Details
#error_message ⇒ Object
35 36 37 |
# File 'lib/buckaruby/exception.rb', line 35 def params[:brq_apierrormessage] end |
#status_code ⇒ Object
31 32 33 |
# File 'lib/buckaruby/exception.rb', line 31 def status_code params[:brq_statuscode] end |
#status_message ⇒ Object
27 28 29 |
# File 'lib/buckaruby/exception.rb', line 27 def params[:brq_statusmessage] end |