Exception: GoCardless::Error
- Inherits:
-
StandardError
- Object
- StandardError
- GoCardless::Error
- Defined in:
- lib/gocardless-pro/error.rb
Overview
A class to represent an API Error
Direct Known Subclasses
GoCardlessError, InvalidApiUsageError, InvalidStateError, ValidationError
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#code ⇒ Object
access the code from the response.
-
#documentation_url ⇒ Object
access the documentation_url from the response.
-
#errors ⇒ Object
access the errors from the response.
-
#initialize(error) ⇒ Error
constructor
intialize a new error @param error the error from the API.
-
#message ⇒ Object
access the message from the response.
-
#request_id ⇒ Object
access the request_id from the response.
-
#type ⇒ Object
access the type from the response.
Constructor Details
#initialize(error) ⇒ Error
intialize a new error @param error the error from the API
8 9 10 |
# File 'lib/gocardless-pro/error.rb', line 8 def initialize(error) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
4 5 6 |
# File 'lib/gocardless-pro/error.rb', line 4 def error @error end |
Instance Method Details
#code ⇒ Object
access the code from the response
28 29 30 |
# File 'lib/gocardless-pro/error.rb', line 28 def code @error['code'] end |
#documentation_url ⇒ Object
access the documentation_url from the response
13 14 15 |
# File 'lib/gocardless-pro/error.rb', line 13 def documentation_url @error['documentation_url'] end |
#errors ⇒ Object
access the errors from the response
38 39 40 |
# File 'lib/gocardless-pro/error.rb', line 38 def errors @error['errors'] end |
#message ⇒ Object
access the message from the response
18 19 20 |
# File 'lib/gocardless-pro/error.rb', line 18 def @error['message'] end |
#request_id ⇒ Object
access the request_id from the response
33 34 35 |
# File 'lib/gocardless-pro/error.rb', line 33 def request_id @error['request_id'] end |
#type ⇒ Object
access the type from the response
23 24 25 |
# File 'lib/gocardless-pro/error.rb', line 23 def type @error['type'] end |