From 7ca21acb25be8f13b201032b96cafe502ad9d2df Mon Sep 17 00:00:00 2001 From: anton Date: Fri, 18 Jan 2013 14:04:21 +0200 Subject: [PATCH] handle situation, when broken copy to query, ends before it is canceled --- lib/native/query.js | 3 +++ lib/query.js | 3 +++ 2 files changed, 6 insertions(+) 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); }