Skip to content

Commit

Permalink
Fix return value of Client.prototype.query in immediate error cases
Browse files Browse the repository at this point in the history
  • Loading branch information
charmander committed Nov 15, 2017
1 parent 0a53fba commit 4c58e3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,14 @@ Client.prototype.query = function (config, values, callback) {
process.nextTick(() => {
query.handleError(new Error('Client has encountered a connection error and is not queryable'), this.connection)
})
return
return result
}

if (this._ending) {
process.nextTick(() => {
query.handleError(new Error('Client was closed and is not queryable'), this.connection)
})
return
return result
}

this.queryQueue.push(query)
Expand Down

0 comments on commit 4c58e3f

Please sign in to comment.