Commit Graph

1 Commits

Author SHA1 Message Date
Ruben Bridgewater
2b5f2bc68b
util: improve internal isError() validation
The current internal isError function checked the toString value
instead of using the more precise `util.types.isNativeError()` check.
The `instanceof` check is not removed due to possible errors that
are not native but still an instance of Error.

PR-URL: https://github.com/nodejs/node/pull/24746
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-12-03 12:37:34 +01:00