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>
parent
1fe824bc
Please register or sign in to comment