You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, code like this will actually throw the error 'RetryOperation timeout occurred' which originates in node-retry. It should throw the error I made ("HI" + Math.random()), but doesn't because of a timeout error.
import * as retry from 'async-retry'
async function throwsErrors(){
await delay(1000)
throw new Error("HI" + Math.random())
}
retry(
async (bail, attempt) => {
await throwsErrors()
} , {
maxRetryTime: 100,
minTimeout: 2,
randomize: true,
retries: 100,
onRetry: console.log
}
).then(console.log)
async function delay(milliseconds: number) {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
I made an issue in node-retry that describes why this happens in detail, but the gist is that if you call retryOperation.retry(err) and there's a timeout error, node-retry drops err. I'm not sure if this is something that node-retry needs to support or if it's something that you can/should handle here.
The text was updated successfully, but these errors were encountered:
Right now, code like this will actually throw the error 'RetryOperation timeout occurred' which originates in node-retry. It should throw the error I made (
"HI" + Math.random()
), but doesn't because of a timeout error.I made an issue in node-retry that describes why this happens in detail, but the gist is that if you call
retryOperation.retry(err)
and there's a timeout error, node-retry dropserr
. I'm not sure if this is something that node-retry needs to support or if it's something that you can/should handle here.The text was updated successfully, but these errors were encountered: