Skip to content

Commit 27bf328

Browse files
juliuszaedevil
authored andcommitted
Fix uncaught error issue
1 parent 4bc19e6 commit 27bf328

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/client.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,20 +424,22 @@ Client.prototype.query = function (config, values, callback) {
424424
queryCallback = query.callback;
425425

426426
readTimeoutTimer = setTimeout(() => {
427-
var error = new Error('Query read timeout');
427+
var error = new Error('Query read timeout')
428428

429429
this.emit('error', error)
430430
queryCallback(error)
431431

432432
// we already returned an error,
433-
// just do nothing when query completes
434-
delete query.callback
433+
// just do nothing if query completes
434+
query.callback = () => {}
435435

436436
// Remove from queue
437437
var index = this.queryQueue.indexOf(query)
438438
if (index > -1) {
439439
this.queryQueue.splice(index, 1)
440440
}
441+
442+
this._pulseQueryQueue()
441443
}, readTimeout)
442444

443445
query.callback = (err, res) => {

0 commit comments

Comments
 (0)