Skip to content

Commit c22ada1

Browse files
util: enhance isError function to support new Error check
1 parent e9b286c commit c22ada1

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
@@ -95,7 +95,7 @@ function isError(e) {
9595
// An error could be an instance of Error while not being a native error
9696
// or could be from a different realm and not be instance of Error but still
9797
// be a native error.
98-
return isNativeError(e) || e instanceof Error;
98+
return Error.isError ? Error.isError(e) : isNativeError(e) || e instanceof Error;
9999
}
100100

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

0 commit comments

Comments
 (0)