From 4baef5e4c6fbf6e655da033bfde2a7193623329a Mon Sep 17 00:00:00 2001 From: "Ch3rry B@ry" Date: Thu, 8 Aug 2024 12:32:03 +0530 Subject: [PATCH] Don't reassign to errors --- src/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connection.js b/src/connection.js index 578a6a02..97cc97e1 100644 --- a/src/connection.js +++ b/src/connection.js @@ -385,7 +385,7 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose } function queryError(query, err) { - Object.defineProperties(err, { + 'query' in err || 'parameters' in err || Object.defineProperties(err, { stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug }, query: { value: query.string, enumerable: options.debug }, parameters: { value: query.parameters, enumerable: options.debug },