diff --git a/lib/client.js b/lib/client.js index 770f353d..a77e5d48 100644 --- a/lib/client.js +++ b/lib/client.js @@ -169,7 +169,7 @@ Client.prototype.connect = function(callback) { self.readyForQuery = true; self._pulseQueryQueue(); if(activeQuery) { - activeQuery.handleReadyForQuery(); + activeQuery.handleReadyForQuery(con); } }); diff --git a/lib/query.js b/lib/query.js index 19a8613e..f6278602 100644 --- a/lib/query.js +++ b/lib/query.js @@ -116,9 +116,9 @@ Query.prototype.handleEmptyQuery = function(con) { } }; -Query.prototype.handleReadyForQuery = function() { +Query.prototype.handleReadyForQuery = function(con) { if(this._canceledDueToError) { - return this.handleError(this._canceledDueToError); + return this.handleError(this._canceledDueToError, con); } if(this.callback) { this.callback(null, this._result);