We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc0e0c5 commit cc69c2aCopy full SHA for cc69c2a
src/axiosBetterStacktrace.ts
@@ -18,7 +18,7 @@ declare module 'axios' {
18
19
// toString used instead of instanceOf for detecting error type to prevent problem mentioned in issue #5
20
const isError = (error: unknown): error is Error =>
21
- Object.prototype.toString.call(error) === '[object Error]';
+ error instanceof Error || Object.prototype.toString.call(error) === '[object Error]';
22
23
const isAxiosError = (error: unknown): error is AxiosError =>
24
isError(error) && (error as AxiosError).isAxiosError;
0 commit comments