Exception: RubstApi::HTTPException
- Inherits:
-
StandardError
- Object
- StandardError
- RubstApi::HTTPException
- Defined in:
- lib/rubst_api/errors.rb
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code:, detail: nil, headers: {}) ⇒ HTTPException
constructor
A new instance of HTTPException.
Constructor Details
#initialize(status_code:, detail: nil, headers: {}) ⇒ HTTPException
Returns a new instance of HTTPException.
7 8 9 10 11 12 |
# File 'lib/rubst_api/errors.rb', line 7 def initialize(status_code:, detail: nil, headers: {}) @status_code = status_code @detail = detail || default_detail(status_code) @headers = headers super(@detail.to_s) end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
5 6 7 |
# File 'lib/rubst_api/errors.rb', line 5 def detail @detail end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/rubst_api/errors.rb', line 5 def headers @headers end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
5 6 7 |
# File 'lib/rubst_api/errors.rb', line 5 def status_code @status_code end |