Skip to content

Commit d73d231

Browse files
committed
Disable Error.captureStackTrace when it's not available on Error object.
1 parent 9803782 commit d73d231

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/internal/BaseError.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export class BaseError<TCode extends string> extends Error {
1111

1212
this.code = code
1313

14-
Error.captureStackTrace(this, this.constructor)
14+
if (typeof Error.captureStackTrace === "function") {
15+
Error.captureStackTrace(this, this.constructor)
16+
}
1517
}
1618
}

0 commit comments

Comments
 (0)