From ce8f215c88583d82b0dde22743f4fdc688942d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Thu, 9 Mar 2017 22:05:26 +0100 Subject: [PATCH] Fix throw in type parsers when in prepared statement (#1242) --- lib/client.js | 2 +- lib/query.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/client.js b/lib/client.js index 770f353..a77e5d4 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 19a8613..f627860 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);