Exception: Bakong::OpenApi::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Bakong::OpenApi::Error
- Defined in:
- lib/bakong/open_api/error.rb
Overview
Base class for every error this gem raises. Carries the upstream HTTP status, the Bakong responseCode/errorCode if the API supplied one, and the raw response body for debugging.
Direct Known Subclasses
AccountInvalidError, AccountNotFoundError, AuthenticationError, BakongUnreachableError, ConnectionError, DeeplinkProviderError, EmailAlreadyRegisteredError, EmailServerDownError, InvalidRequestError, MissingFieldsError, NotFoundError, NotRegisteredError, RateLimitError, ServerError, StaticQrNotSupportedError, TokenExpiredError, TransactionFailedError, TransactionNotFoundError, UnauthorizedError
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#response_code ⇒ Object
readonly
Returns the value of attribute response_code.
-
#response_message ⇒ Object
readonly
Returns the value of attribute response_message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message = nil, status: nil, response_code: nil, error_code: nil, response_message: nil, body: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message = nil, status: nil, response_code: nil, error_code: nil, response_message: nil, body: nil) ⇒ Error
Returns a new instance of Error.
11 12 13 14 15 16 17 18 |
# File 'lib/bakong/open_api/error.rb', line 11 def initialize( = nil, status: nil, response_code: nil, error_code: nil, response_message: nil, body: nil) @status = status @response_code = response_code @error_code = error_code @response_message = @body = body super( || || "Bakong Open API error") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/bakong/open_api/error.rb', line 9 def body @body end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
9 10 11 |
# File 'lib/bakong/open_api/error.rb', line 9 def error_code @error_code end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
9 10 11 |
# File 'lib/bakong/open_api/error.rb', line 9 def response_code @response_code end |
#response_message ⇒ Object (readonly)
Returns the value of attribute response_message.
9 10 11 |
# File 'lib/bakong/open_api/error.rb', line 9 def @response_message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/bakong/open_api/error.rb', line 9 def status @status end |