Exception: Featureflip::HttpStatusError

Inherits:
Error
  • Object
show all
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 : " message, so callers rescuing Featureflip::Error — or matching on that message — are unaffected.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#statusObject (readonly)

Returns the value of attribute status.



27
28
29
# File 'lib/featureflip/errors.rb', line 27

def status
  @status
end