Skip to content

Commit 1f56578

Browse files
util: enhance isError function to support new Error check
1 parent 5f252a4 commit 1f56578

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function isError(e) {
9696
// An error could be an instance of Error while not being a native error
9797
// or could be from a different realm and not be instance of Error but still
9898
// be a native error.
99-
return isNativeError(e) || e instanceof Error;
99+
return Error.isError ? Error.isError(e) : isNativeError(e) || e instanceof Error;
100100
}
101101

102102
// Keep a list of deprecation codes that have been warned on so we only warn on

0 commit comments

Comments
 (0)