From 54fb24aafc83dedeae5e3a7ec56e64eb16c15ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 9 Aug 2021 14:37:45 +0300 Subject: [PATCH] Change UNKNOWN_CODE_PLEASE_REPORT to identify uknown code Changes UNKNOWN_CODE_PLEASE_REPORT to include packet.errno in it. This makes it easier to identify what the code is even if the code is not yet supported: ``` (node:1) UnhandledPromiseRejectionWarning: Error: UNKNOWN_CODE_PLEASE_REPORT: Query execution was interrupted, query_timeout exceeded ``` --- lib/protocol/sequences/Sequence.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protocol/sequences/Sequence.js b/lib/protocol/sequences/Sequence.js index de82dc270..29ae79687 100644 --- a/lib/protocol/sequences/Sequence.js +++ b/lib/protocol/sequences/Sequence.js @@ -44,7 +44,7 @@ Sequence.prototype.hasErrorHandler = function() { Sequence.prototype._packetToError = function(packet) { var code = ErrorConstants[packet.errno] || 'UNKNOWN_CODE_PLEASE_REPORT'; - var err = new Error(code + ': ' + packet.message); + var err = new Error(code + '[' + packet.errno + ']: ' + packet.message); err.code = code; err.errno = packet.errno;