diff --git a/lib/native/query.js b/lib/native/query.js index 26e1f506..c6dc0f9f 100644 --- a/lib/native/query.js +++ b/lib/native/query.js @@ -64,6 +64,9 @@ p.handleError = function(error) { } p.handleReadyForQuery = function(meta) { + if (this._canceledDueToError) { + return this.handleError(this._canceledDueToError); + } if(meta) { this._result.addCommandComplete(meta); } diff --git a/lib/query.js b/lib/query.js index 5c877aa9..7934cd4e 100644 --- a/lib/query.js +++ b/lib/query.js @@ -93,6 +93,9 @@ p.handleCommandComplete = function(msg) { }; p.handleReadyForQuery = function() { + if (this._canceledDueToError) { + return this.handleError(this._canceledDueToError); + } if(this.callback) { this.callback(null, this._result); }