diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a5534f2..f4030e26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: build: strategy: matrix: - node: [16, 18, 20, 21] + node: [16, 18, 20, 22] os: [ubuntu-22.04] include: # single mac test due to minute multipliers diff --git a/lib/error.js b/lib/error.js index 1795dbfe..add99cbb 100644 --- a/lib/error.js +++ b/lib/error.js @@ -405,7 +405,7 @@ function LibrdKafkaError(e) { this.origin = 'kafka'; } Error.captureStackTrace(this, this.constructor); - } else if (!util.isError(e)) { + } else if (!(Object.prototype.toString(e) === "[object Error]" || e instanceof Error)) { // This is the better way this.message = e.message; this.code = e.code;