Skip to content

Commit fdf5a4a

Browse files
committed
Fix return value of Client.prototype.query in immediate error cases
1 parent 7b6b7a1 commit fdf5a4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,14 @@ Client.prototype.query = function (config, values, callback) {
428428
process.nextTick(() => {
429429
query.handleError(new Error('Client has encountered a connection error and is not queryable'), this.connection)
430430
})
431-
return
431+
return result
432432
}
433433

434434
if (this._ending) {
435435
process.nextTick(() => {
436436
query.handleError(new Error('Client was closed and is not queryable'), this.connection)
437437
})
438-
return
438+
return result
439439
}
440440

441441
this.queryQueue.push(query)

0 commit comments

Comments
 (0)