Exception: Bond::BondError
- Inherits:
-
StandardError
- Object
- StandardError
- Bond::BondError
- Defined in:
- lib/bond/errors.rb
Instance Attribute Summary collapse
-
#application_error_code ⇒ Object
readonly
Returns the value of attribute application_error_code.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message) ⇒ BondError
constructor
A new instance of BondError.
Constructor Details
#initialize(message) ⇒ BondError
Returns a new instance of BondError.
17 18 19 |
# File 'lib/bond/errors.rb', line 17 def initialize() super() end |
Instance Attribute Details
#application_error_code ⇒ Object (readonly)
Returns the value of attribute application_error_code.
3 4 5 |
# File 'lib/bond/errors.rb', line 3 def application_error_code @application_error_code end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
3 4 5 |
# File 'lib/bond/errors.rb', line 3 def http_code @http_code end |
Class Method Details
.handle_errors(json) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/bond/errors.rb', line 7 def handle_errors(json) errors = json['errors'] if errors = errors.map { |error| "Code: #{error['code']}. Message: #{error['message']}" }.join(' ') raise Bond::BondError.new() end end |