Skip to content

Commit 7ca21ac

Browse files
antonbrianc
anton
authored andcommitted
handle situation, when broken copy to query, ends before it is canceled
1 parent 8ea2f25 commit 7ca21ac

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/native/query.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ p.handleError = function(error) {
6464
}
6565

6666
p.handleReadyForQuery = function(meta) {
67+
if (this._canceledDueToError) {
68+
return this.handleError(this._canceledDueToError);
69+
}
6770
if(meta) {
6871
this._result.addCommandComplete(meta);
6972
}

lib/query.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ p.handleCommandComplete = function(msg) {
9393
};
9494

9595
p.handleReadyForQuery = function() {
96+
if (this._canceledDueToError) {
97+
return this.handleError(this._canceledDueToError);
98+
}
9699
if(this.callback) {
97100
this.callback(null, this._result);
98101
}

0 commit comments

Comments
 (0)