From 7c9f84795fdcb356ad965b482b1eade6a8fdba82 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 hat 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..889470021 100644 --- a/lib/protocol/sequences/Sequence.js +++ b/lib/protocol/sequences/Sequence.js @@ -43,7 +43,7 @@ Sequence.prototype.hasErrorHandler = function() { }; Sequence.prototype._packetToError = function(packet) { - var code = ErrorConstants[packet.errno] || 'UNKNOWN_CODE_PLEASE_REPORT'; + var code = ErrorConstants[packet.errno] || 'UNKNOWN_CODE_PLEASE_REPORT: ' + packet.errno; var err = new Error(code + ': ' + packet.message); err.code = code; err.errno = packet.errno;