Skip to content

Commit 5e4dad5

Browse files
committed
fix(fetch): avoid throwing error on polyfilled envs
1 parent 5fa7d65 commit 5e4dad5

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/requester-fetch/src/createFetchRequester.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { Request, Requester, Response as AlgoliaResponse } from '@algolia/requester-common';
22

33
function isAbortError(error: unknown): boolean {
4-
return (
5-
// browser fetch
6-
(error instanceof DOMException && error.name === 'AbortError') ||
7-
// node-fetch or undici
8-
(error instanceof Error && error.name === 'AbortError')
9-
);
4+
return error instanceof Error && error.name === 'AbortError';
105
}
116

127
function getErrorMessage(error: unknown, abortContent: string): string {

0 commit comments

Comments
 (0)