Exception: Featureflip::HttpStatusError
- Defined in:
- lib/featureflip/errors.rb
Overview
Raised when the API answers a request with a non-success status. Carries the status so a caller can decide what to do about it.
The events flush is the caller that has to: it re-queues a batch a later attempt could plausibly deliver (5xx, 429) and drops one the server will reject identically forever (401/403 = key rejected, 400 = malformed body). Before this the status only existed inside the message string, so every failure looked alike and the batch was dropped either way (#2456).
Subclasses Error and keeps the historical "HTTP :
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, path) ⇒ HttpStatusError
constructor
A new instance of HttpStatusError.
Constructor Details
#initialize(status, path) ⇒ HttpStatusError
Returns a new instance of HttpStatusError.
29 30 31 32 |
# File 'lib/featureflip/errors.rb', line 29 def initialize(status, path) @status = status super("HTTP #{status}: #{path}") end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
27 28 29 |
# File 'lib/featureflip/errors.rb', line 27 def status @status end |