File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
2- const {
3- ErrorIsError,
4- } = primordials ;
2+ const { isNativeError } = require ( 'internal/util/types' ) ;
53
64/**
75 * Serializes an Error object
86 * @param {Error } error
97 * @returns {object }
108 */
119function serializeErr ( error ) {
12- if ( ! ErrorIsError ( error ) ) {
10+ if ( ! isNativeError ( error ) ) {
1311 return error ;
1412 }
1513
Original file line number Diff line number Diff line change 99 SafeSet,
1010} = primordials ;
1111
12+ // Add isNativeError from internal/util/types
13+ const { isNativeError } = require ( 'internal/util/types' ) ;
14+
1215
1316const {
1417 codes : {
@@ -384,7 +387,7 @@ class Logger {
384387 * @private
385388 */
386389 #isError( value ) {
387- return value instanceof Error ;
390+ return isNativeError ( value ) ;
388391 }
389392
390393 /**
You can’t perform that action at this time.
0 commit comments