From 2194d0549ca560cc310dd053f5157ef16bdceb18 Mon Sep 17 00:00:00 2001 From: Arya Date: Thu, 20 Feb 2025 10:55:42 +0530 Subject: [PATCH] fix: remove deprecated util.isError usage --- lib/error.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/error.js b/lib/error.js index 869cc2e1..c36d5e58 100644 --- a/lib/error.js +++ b/lib/error.js @@ -407,7 +407,7 @@ function LibrdKafkaError(e) { this.origin = 'kafka'; } Error.captureStackTrace(this, this.constructor); - } else if (!util.isError(e)) { + } else if (!(e instanceof Error || Object.prototype.toString.call(e) === '[object Error]')) { // This is the better way this.message = e.message; this.code = e.code;