Exception: Tango::Api::Errors::HttpError
- Inherits:
-
StandardError
- Object
- StandardError
- Tango::Api::Errors::HttpError
- Defined in:
- lib/tango/api/errors.rb
Overview
Base HTTP error carrying status, body, request id and optional i18n key.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#i18n_key ⇒ Object
readonly
Returns the value of attribute i18n_key.
-
#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, i18n_key: nil) ⇒ HttpError
constructor
A new instance of HttpError.
Constructor Details
#initialize(message, status:, body: nil, request_id: nil, i18n_key: nil) ⇒ HttpError
Returns a new instance of HttpError.
10 11 12 13 14 15 16 |
# File 'lib/tango/api/errors.rb', line 10 def initialize(, status:, body: nil, request_id: nil, i18n_key: nil) super() @status = status @body = body @request_id = request_id @i18n_key = i18n_key end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
8 9 10 |
# File 'lib/tango/api/errors.rb', line 8 def body @body end |
#i18n_key ⇒ Object (readonly)
Returns the value of attribute i18n_key.
8 9 10 |
# File 'lib/tango/api/errors.rb', line 8 def i18n_key @i18n_key end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
8 9 10 |
# File 'lib/tango/api/errors.rb', line 8 def request_id @request_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/tango/api/errors.rb', line 8 def status @status end |