Skip to content

Commit dc7615d

Browse files
authored
fix: remove deprecated util.isError usage
- Replaced util.isError(e) with instanceof Error and Object.prototype.toString.call(e) === '[object Error]' - Ensured compatibility with Node.js v23
1 parent b92be2a commit dc7615d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ function LibrdKafkaError(e) {
407407
this.origin = 'kafka';
408408
}
409409
Error.captureStackTrace(this, this.constructor);
410-
} else if (!util.isError(e)) {
410+
} else if (e instanceof Error || Object.prototype.toString.call(e) === '[object Error]') {
411411
// This is the better way
412412
this.message = e.message;
413413
this.code = e.code;

0 commit comments

Comments
 (0)