Exception: DearInventory::RequestError
- Extended by:
- T::Sig
- Defined in:
- lib/dear_inventory/errors/request.rb
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
- #http_body ⇒ Object
- #http_headers ⇒ Object
- #http_status ⇒ Object
-
#initialize(message = nil, response = nil) ⇒ RequestError
constructor
A new instance of RequestError.
- #uri ⇒ Object
Constructor Details
#initialize(message = nil, response = nil) ⇒ RequestError
14 15 16 17 18 |
# File 'lib/dear_inventory/errors/request.rb', line 14 def initialize( = nil, response = nil) super() @response = T.let(response, T.nilable(DearInventory::Response)) end |
Instance Method Details
#http_body ⇒ Object
21 22 23 |
# File 'lib/dear_inventory/errors/request.rb', line 21 def http_body @response&.error || @response&.body&.to_s end |
#http_headers ⇒ Object
26 27 28 |
# File 'lib/dear_inventory/errors/request.rb', line 26 def http_headers @response&.headers end |
#http_status ⇒ Object
31 32 33 |
# File 'lib/dear_inventory/errors/request.rb', line 31 def http_status @response&.http_status end |
#uri ⇒ Object
36 37 38 |
# File 'lib/dear_inventory/errors/request.rb', line 36 def uri @response&.uri&.to_s end |