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 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
```
  • Loading branch information
glensc committed Sep 15, 2021
1 parent 3430c51 commit 54fb24a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/protocol/sequences/Sequence.js
Expand Up @@ -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;

Expand Down

0 comments on commit 54fb24a

Please sign in to comment.