Exception: Barzahlen::Error::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- Barzahlen::Error::ApiError
- Defined in:
- lib/barzahlen/error.rb
Direct Known Subclasses
AuthError, IdempotencyError, InvalidFormatError, InvalidParameterError, InvalidStateError, NotAllowedError, RateLimitError, ServerError, TransportError, UnexpectedError
Instance Attribute Summary collapse
-
#documentation_url ⇒ Object
readonly
Returns the value of attribute documentation_url.
-
#error_class ⇒ Object
readonly
Returns the value of attribute error_class.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
Instance Method Summary collapse
-
#initialize(error_hash = {}) ⇒ ApiError
constructor
A new instance of ApiError.
- #message ⇒ Object (also: #to_s)
Constructor Details
#initialize(error_hash = {}) ⇒ ApiError
Returns a new instance of ApiError.
28 29 30 31 32 33 34 |
# File 'lib/barzahlen/error.rb', line 28 def initialize(error_hash = {}) @error_class = error_hash[:error_class] @error_code = error_hash[:error_code] @error_message = error_hash[:message] @documentation_url = error_hash[:documentation_url] @request_id = error_hash[:request_id] end |
Instance Attribute Details
#documentation_url ⇒ Object (readonly)
Returns the value of attribute documentation_url.
25 26 27 |
# File 'lib/barzahlen/error.rb', line 25 def documentation_url @documentation_url end |
#error_class ⇒ Object (readonly)
Returns the value of attribute error_class.
22 23 24 |
# File 'lib/barzahlen/error.rb', line 22 def error_class @error_class end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
23 24 25 |
# File 'lib/barzahlen/error.rb', line 23 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
24 25 26 |
# File 'lib/barzahlen/error.rb', line 24 def @error_message end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
26 27 28 |
# File 'lib/barzahlen/error.rb', line 26 def request_id @request_id end |
Instance Method Details
#message ⇒ Object Also known as: to_s
36 37 38 |
# File 'lib/barzahlen/error.rb', line 36 def return "Error occurred with: #{@error_message}" end |