Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
If you pass a timeout to make-fetch-happen
which the call then supersedes, the promise rejection here is not caught causing an "Unhandled Rejection at Promise" exception.
Expected Behavior
The try / catch here, should be extended to catch the promise rejection, so the call can be handled by the Retry Handler.
Steps To Reproduce
- In this environment...
Node 20, 22
- With this config...
{
method: 'GET',
timeout: 10_000,
agent: ...,
headers: ...,
retry: { retries: 2, maxTimeout: 10_000 },
}
- Run
const result = await fetch(url, options)
- When url get exceeds timeout
Expected, Retry to happen
Got,
Unhandled Rejection at Promise
network timeout at: SOME_URL at Timeout.<anonymous> (/app/node_modules/minipass-fetch/lib/index.js:108:18) at listOnTimeout (node:internal/timers:594:17) at process.processTimers (node:internal/timers:529:7)
Environment
- npm: 10.8.2
- Node: v22.7.0, v20..
- OS: Mac OS, Linux (Alpine latest)