-
-
Notifications
You must be signed in to change notification settings - Fork 443
Open
Labels
bugSomething isn't workingSomething isn't working
Description
try {
await Promise.race([
new Promise((resolve, reject) => setTimeout(() => reject(new Error("my timeout")), 2000)),
ky("https://pie.dev/status/429", {
retry: {
limit: 15,
},
timeout: 1000,
}),
]);
} catch (err: unknown) {
console.log(err); // Error: my timeout
}
The documentation says:
Timeout in milliseconds for getting a response, including any retries. Can not be greater than 2147483647. If set to false, there will be no timeout.
Reading this, I expected the code above to throw TimeoutError after 1000 ms, but rather it throws "my timeout" after 2000 ms.
What was the real intention here?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working