Exception: LittleGhost::Providers::HTTPError
- Inherits:
-
LittleGhost::ProviderError
- Object
- StandardError
- Error
- LittleGhost::ProviderError
- LittleGhost::Providers::HTTPError
- Defined in:
- lib/little_ghost/providers/http_transport.rb
Overview
Reports an HTTP or network failure from a provider transport.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
HTTP status and bounded response body, when the server supplied them.
-
#status ⇒ Object
readonly
HTTP status and bounded response body, when the server supplied them.
Instance Method Summary collapse
-
#initialize(message, status: nil, body: nil) ⇒ HTTPError
constructor
Creates an error with optional response details.
-
#retryable? ⇒ Boolean
Indicates whether a provider client may retry the request.
Constructor Details
#initialize(message, status: nil, body: nil) ⇒ HTTPError
Creates an error with optional response details.
15 16 17 18 19 |
# File 'lib/little_ghost/providers/http_transport.rb', line 15 def initialize(, status: nil, body: nil) @status = status @body = body super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
HTTP status and bounded response body, when the server supplied them.
12 13 14 |
# File 'lib/little_ghost/providers/http_transport.rb', line 12 def body @body end |
#status ⇒ Object (readonly)
HTTP status and bounded response body, when the server supplied them.
12 13 14 |
# File 'lib/little_ghost/providers/http_transport.rb', line 12 def status @status end |
Instance Method Details
#retryable? ⇒ Boolean
Indicates whether a provider client may retry the request.
22 23 24 |
# File 'lib/little_ghost/providers/http_transport.rb', line 22 def retryable? status.nil? || status == 408 || status == 409 || status == 429 || status >= 500 end |