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 c9fed60 commit 8a2c161Copy full SHA for 8a2c161
src/errors.ts
@@ -31,7 +31,7 @@ export function isErrorLike(error: any): error is ErrorLike {
31
export function asErrorLike(error: any): ErrorLike {
32
if (isErrorLike(error)) return error as ErrorLike;
33
else {
34
- return new Error(error.message || error.toString());
+ return new Error(error.message || error?.toString() || '[unknown error]');
35
}
36
37
0 commit comments