Exception in function shouldRetryRequest() when checking HTTP methods to retry
See original GitHub issueIn function shouldRetryRequest
there’s this block of code
// Only retry with configured HttpMethods.
if (!err.config.method ||
config.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) {
return false;
}
that fails evaluating second condition, because httpMethodsToRetry
is an object, not an array.
Below goes the output from dev console, when the breakpoint was set on the line given above ^^^:
config.httpMethodsToRetry
{0: "GET", 1: "HEAD", 2: "OPTIONS", 3: "DELETE", 4: "PUT"}
That looks different from what gets set in raxConfig
const raxConfig = {
....
// HTTP methods to automatically retry. Defaults to:
// ['GET', 'HEAD', 'OPTIONS', 'DELETE', 'PUT']
httpMethodsToRetry: ['GET', 'HEAD', 'OPTIONS', 'DELETE', 'PUT'],
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:16 (4 by maintainers)
Top Results From Across the Web
How to implement retry mechanism into python requests library?
This snippet of code will make all HTTP requests from the same session retry for a total of 5 times, sleeping between retries...
Read more >Best Practices for Retry - Denali Balser
A retry is a mechanism that monitors a request, and on the detection of failure ... To get more specific, HTTP methods that...
Read more >Retry HTTP Request with Backoff Strategy - Akinjide Bankole
Retrying HTTP Requests when network fails due to poor connection or server timeouts.
Read more >org.jclouds.http.HttpCommand java code examples - Tabnine
public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.
Read more >How To Retry HTTP Requests Using a Decorator in Python
Failed requests to a server can cause us all sorts of issues, but rather than just handle the exception and log it away,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@JustinBeckwith
v0.19.0-beta.1
. Please see my comment. Now options are completely whitelisted and it doesn’t acceptraxConfig
.I am also getting error,
Here is my relevant code,
And here is the error,