RETRY options to ignore statuses and use try #429
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on #404 and some
observations of my own I humbly submit this pull request that adds two
new arguments to
RETRY
.safe_statuses
is an integer vector of HTTP status codes that shouldnot trigger a retry, overruling the result of a call to
http_error
.use_try
is meant to handle the cases where curl signals an error(i.e., with
stop
) for transient situations such as a DNS lookupfailure or a connection error. If
use_try
is set toTRUE
thenRETRY
will call
try(request_perform(..))
and retry the operation if anerror is signaled.
Both parameters have sensible default values so that this change
doesn’t introduce breaking changes and RETRY behaves as it did before
if they are not overridden.