Skip to content

Commit e675a32

Browse files
committed
sometimes DOMExceptions aren't Errors, apparently
1 parent 094cbe7 commit e675a32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/toolkit/src/query/fetchBaseQuery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ export function fetchBaseQuery({
305305
return {
306306
error: {
307307
status:
308-
e instanceof Error && e.name === 'TimeoutError'
308+
(e instanceof Error || e instanceof DOMException) &&
309+
e.name === 'TimeoutError'
309310
? 'TIMEOUT_ERROR'
310311
: 'FETCH_ERROR',
311312
error: String(e),

0 commit comments

Comments
 (0)