From c22ada1520575d04266ad2c27e7ee397c9910e90 Mon Sep 17 00:00:00 2001 From: Miguel Marcondes Date: Mon, 21 Apr 2025 14:17:08 -0300 Subject: [PATCH] util: enhance isError function to support new Error check --- lib/internal/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/util.js b/lib/internal/util.js index 6177b151feea3c..186413a3b6cbe4 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -95,7 +95,7 @@ function isError(e) { // An error could be an instance of Error while not being a native error // or could be from a different realm and not be instance of Error but still // be a native error. - return isNativeError(e) || e instanceof Error; + return Error.isError ? Error.isError(e) : isNativeError(e) || e instanceof Error; } // Keep a list of deprecation codes that have been warned on so we only warn on