We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I get several errors that I want to catch. However, I have tried to catch them, but I do not succeed.
The issue is the following: ECONNRESET, ETIMEDOUT, request-timeout, body-timeout.
When these errors occur, I want to set my error variable to true.
The app always crashes when these errors occur, I would like to prevent this by catching the error.
NodeJS v16
const response = await fetch(loadedFeed[i], { retryOptions: { timeout: 3000, retryOnHttpResponse: function (response) { if(response.status !== 200){ error = true; console.log("Site not work"); } }, retryOnHttpError(err){ if(err === true){ error = true; } if(err.message === 'ECONNRESET'){ error = true; } if(err.message === 'ETIMEDOUT'){ error = true; } if(err.message === 'request-timeout'){ error = true; } if(err.message === 'body-timeout'){ error = true; } } } });
C:\Users\admin\Desktop\v01\node_modules@adobe\node-fetch-retry\index.js:230 return reject(new FetchError(network timeout at ${url}, 'request-timeout')); ^ FetchError: network timeout at https://www.star.com.tr/rss/rss.asp?cid=14 at wrappedFetch (C:\Users\admin\Desktop\01\node_modules@adobe\node-fetch-retry\index.js:230:43) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) { type: 'request-timeout' }
network timeout at ${url}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I get several errors that I want to catch.
However, I have tried to catch them, but I do not succeed.
The issue is the following: ECONNRESET, ETIMEDOUT, request-timeout, body-timeout.
When these errors occur, I want to set my error variable to true.
The app always crashes when these errors occur, I would like to prevent this by catching the error.
Platform and Version
NodeJS v16
Sample Code that illustrates the problem
Logs taken while reproducing problem
C:\Users\admin\Desktop\v01\node_modules@adobe\node-fetch-retry\index.js:230
return reject(new FetchError(
network timeout at ${url}
, 'request-timeout'));^
FetchError: network timeout at https://www.star.com.tr/rss/rss.asp?cid=14
at wrappedFetch (C:\Users\admin\Desktop\01\node_modules@adobe\node-fetch-retry\index.js:230:43)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
type: 'request-timeout'
}
The text was updated successfully, but these errors were encountered: