-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Open
Description
Describe the bug
On a request timeout Axios should throw an AxiosError, but when using the fetch adapter in Safari a TypeError: The DOMException.message getter can only be used on instances of DOMException is thrown.
userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15
To Reproduce
- Use Safari
- Make a request using the
fetchadapter and make it timeout - On timeout it throws a
TypeError: The DOMException.message getter can only be used on instances of DOMException
Sandbox with a request that always ends in timeout: https://codesandbox.io/p/sandbox/zkm26r
Code snippet
axios.get("https://fakeresponder.com/?sleep=50000", { adapter: "fetch", timeout: 2000 });
axios.get("https://api.example.com", { adapter: "fetch", timeout: 1 });Expected behavior
Should throw an AxiosError with the timeout info, like the default adapter:
{
message: "timeout 2000 of ms exceeded",
code: "ETIMEDOUT",
name: "AxiosError"
}Axios Version
1.13.0
Adapter Version
fetch
Browser
Safari
Browser Version
26.0.1
Node.js Version
No response
OS
OSX 15.6.1
Additional Library Versions
noneAdditional context/Screenshots
Metadata
Metadata
Assignees
Labels
No labels