Exception: LittleGhost::Providers::HTTPError
- Inherits:
-
LittleGhost::ProviderError
- Object
- StandardError
- Error
- LittleGhost::ProviderError
- LittleGhost::Providers::HTTPError
- Defined in:
- lib/little_ghost/providers/base.rb
Overview
Reports a bounded HTTP or network failure from a provider connection.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
HTTP status, when a response was received, and the bounded response body.
-
#status ⇒ Object
readonly
HTTP status, when a response was received, and the bounded response body.
Instance Method Summary collapse
-
#initialize(message, status: nil, body: nil) ⇒ HTTPError
constructor
Captures a provider failure without retaining an unbounded response.
-
#retryable? ⇒ Boolean
Whether retrying the same provider request may succeed.
Constructor Details
#initialize(message, status: nil, body: nil) ⇒ HTTPError
Captures a provider failure without retaining an unbounded response.
11 12 13 14 15 |
# File 'lib/little_ghost/providers/base.rb', line 11 def initialize(, status: nil, body: nil) @status = status @body = body super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
HTTP status, when a response was received, and the bounded response body.
8 9 10 |
# File 'lib/little_ghost/providers/base.rb', line 8 def body @body end |
#status ⇒ Object (readonly)
HTTP status, when a response was received, and the bounded response body.
8 9 10 |
# File 'lib/little_ghost/providers/base.rb', line 8 def status @status end |
Instance Method Details
#retryable? ⇒ Boolean
Whether retrying the same provider request may succeed.
18 19 20 |
# File 'lib/little_ghost/providers/base.rb', line 18 def retryable? status.nil? || status == 408 || status == 409 || status == 429 || status >= 500 end |