Skip to content

Commit 7f45ee4

Browse files
committed
lib: use ErrorIsError
1 parent b216a27 commit 7f45ee4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/logger.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
const {
44
DateNow,
5-
Error,
5+
ErrorIsError,
66
JSONStringify,
77
ObjectAssign,
88
ObjectKeys,
9-
ObjectPrototypeToString,
109
SafeSet,
1110
} = primordials;
1211

@@ -264,10 +263,7 @@ class Logger {
264263
* @private
265264
*/
266265
_isError(value) {
267-
return value !== null &&
268-
typeof value === 'object' &&
269-
(ObjectPrototypeToString(value) === '[object Error]' ||
270-
value instanceof Error);
266+
return ErrorIsError(value);
271267
}
272268

273269
/**

0 commit comments

Comments
 (0)