I use:
fetch("/test", { signal: AbortSignal.timeout(2000) })
.then(r => r.json())
.then(r => { console.log(r["data"]) });
with the method from Fetch API request timeout? to abort the request after 2 seconds if no response.
In the case of a timeout, I have a JS error in the console:
Uncaught (in promise) DOMException: The operation timed out.
What’s the simplest way to avoid having this reported as an error?
I would like the timeouts to be silently ignored.