We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51a28c2 commit 64d6883Copy full SHA for 64d6883
lib/client.js
@@ -170,9 +170,17 @@ Client.prototype.connect = function(callback) {
170
return self.emit('error', error);
171
}
172
callback(error);
173
+ callback = null;
174
});
175
176
con.once('end', function() {
177
+ if ( callback ) {
178
+ // haven't received a connection message yet !
179
+ var err = new Error("Stream unexpectedly ended before getting ready for query execution");
180
+ callback(err);
181
182
+ return;
183
+ }
184
if(self.activeQuery) {
185
var disconnectError = new Error('Stream unexpectedly ended during query execution');
186
self.activeQuery.handleError(disconnectError);
0 commit comments