Skip to content

Commit

Permalink
Change UNKNOWN_CODE_PLEASE_REPORT to identify uknown code
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
glensc committed Sep 15, 2021
1 parent 3430c51 commit 7c9f847
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/protocol/sequences/Sequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7c9f847

Please sign in to comment.