Skip to content

Commit 2995832

Browse files
committed
Refactor error serialization to use Error.isError instead of isNativeError
1 parent 76b0742 commit 2995832

File tree

2 files changed

+1
-37
lines changed

2 files changed

+1
-37
lines changed

benchmark/util/is-native-error.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

lib/internal/logger/serializers.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
'use strict';
2-
const { isNativeError } = require('internal/util/types');
32

43
/**
54
* Serializes an Error object
65
* @param {Error} error
76
* @returns {{ type: string, message: string, stack: string, code?: any, cause?: any } | Error }
87
*/
98
function serializeErr(error) {
10-
if (!isNativeError(error)) {
9+
if (!Error.isError(error)) {
1110
return error;
1211
}
1312

0 commit comments

Comments
 (0)