Exception: Tosspayments2::Rails::APIError
- Defined in:
- lib/tosspayments2/rails/errors.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message, status:, body: nil, request_id: nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(message, status:, body: nil, request_id: nil) ⇒ APIError
Returns a new instance of APIError.
12 13 14 15 16 17 18 |
# File 'lib/tosspayments2/rails/errors.rb', line 12 def initialize(, status:, body: nil, request_id: nil) super() @status = status @body = body @code = (body && body[:code]) || (body && body[:errorCode]) @request_id = request_id || (body && body[:request_id]) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
10 11 12 |
# File 'lib/tosspayments2/rails/errors.rb', line 10 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/tosspayments2/rails/errors.rb', line 10 def code @code end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
10 11 12 |
# File 'lib/tosspayments2/rails/errors.rb', line 10 def request_id @request_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
10 11 12 |
# File 'lib/tosspayments2/rails/errors.rb', line 10 def status @status end |