Class: HTTPX::ErrorResponse
- Inherits:
-
Object
- Object
- HTTPX::ErrorResponse
- Includes:
- Loggable
- Defined in:
- lib/httpx/response.rb
Constant Summary
Constants included from Loggable
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#retries ⇒ Object
readonly
Returns the value of attribute retries.
Instance Method Summary collapse
-
#initialize(error, retries, options) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #raise_for_status ⇒ Object
- #retryable? ⇒ Boolean
- #status ⇒ Object
Methods included from Loggable
Constructor Details
#initialize(error, retries, options) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
221 222 223 224 225 226 227 |
# File 'lib/httpx/response.rb', line 221 def initialize(error, retries, ) @error = error @retries = retries = Options.new() log { "#{error.class}: #{error}" } log { caller.join("\n") } end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
219 220 221 |
# File 'lib/httpx/response.rb', line 219 def error @error end |
#retries ⇒ Object (readonly)
Returns the value of attribute retries.
219 220 221 |
# File 'lib/httpx/response.rb', line 219 def retries @retries end |
Instance Method Details
#raise_for_status ⇒ Object
233 234 235 |
# File 'lib/httpx/response.rb', line 233 def raise_for_status raise @error end |
#retryable? ⇒ Boolean
237 238 239 |
# File 'lib/httpx/response.rb', line 237 def retryable? @retries.positive? end |
#status ⇒ Object
229 230 231 |
# File 'lib/httpx/response.rb', line 229 def status @error. end |