File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const Packets = require('./packets/index.js');
2929const Commands = require ( './commands/index.js' ) ;
3030const ConnectionConfig = require ( './connection_config.js' ) ;
3131const CharsetToEncoding = require ( './constants/charset_encodings.js' ) ;
32+ const ErrorCodeToName = require ( './constants/errors.js' ) ;
3233
3334let _connectionId = 0 ;
3435
@@ -445,7 +446,7 @@ class Connection extends EventEmitter {
445446 // If it's an Err Packet, we should use it.
446447 if ( marker === 0xff ) {
447448 const error = Packets . Error . fromPacket ( packet ) ;
448- this . protocolError ( error . message , error . code ) ;
449+ this . protocolError ( error . message , ErrorCodeToName [ error . code ] ) ;
449450 } else {
450451 // Otherwise, it means it's some other unexpected packet.
451452 this . protocolError (
Original file line number Diff line number Diff line change 22
33'use strict' ;
44
5- const errors = require ( '../../lib/constants/errors' ) ;
65const common = require ( '../common' ) ;
76const connection = common . createConnection ( ) ;
87const assert = require ( 'assert' ) ;
@@ -40,5 +39,5 @@ process.on('uncaughtException', err => {
4039
4140process . on ( 'exit' , ( ) => {
4241 assert . equal ( error . message , 'The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.' ) ;
43- assert . equal ( error . code , errors . ER_CLIENT_INTERACTION_TIMEOUT ) ;
42+ assert . equal ( error . code , ' ER_CLIENT_INTERACTION_TIMEOUT' ) ;
4443} ) ;
You can’t perform that action at this time.
0 commit comments