Exception: ActiveSanction::HttpClient::ResponseError
- Inherits:
-
Error
- Object
- StandardError
- SourceError
- FetchError
- Error
- ActiveSanction::HttpClient::ResponseError
- Extended by:
- T::Sig
- Defined in:
- lib/active_sanction/http_client/errors.rb
Overview
Raised by Response#success! for a status the caller declared fatal. It
carries the response, so a rescuer can still log what came back, and the
status, so retryable? answers from it without anybody unwrapping the
response to look: a 503 is retryable, a 403 for a missing User-Agent is
not. See FetchError::RETRYABLE_STATUSES.
Instance Attribute Summary collapse
- #response ⇒ Response readonly
Attributes included from Error
Instance Method Summary collapse
-
#initialize(response) ⇒ void
constructor
Which list this was is stamped on afterwards, by the adapter -- see Error#in_source.
Methods inherited from FetchError
Methods included from Error
#in_source, #retryable?, #to_h
Constructor Details
#initialize(response) ⇒ void
Which list this was is stamped on afterwards, by the adapter -- see Error#in_source. This layer has a URL and no idea what is behind it.
88 89 90 91 |
# File 'lib/active_sanction/http_client/errors.rb', line 88 def initialize(response) @response = T.let(response, Response) super("#{response.uri} returned #{response.status}", status: response.status) end |
Instance Attribute Details
#response ⇒ Response (readonly)
83 84 85 |
# File 'lib/active_sanction/http_client/errors.rb', line 83 def response @response end |