Skip to content

Commit f8655b2

Browse files
committed
Changed close to _close and timing of emit on error event.
1 parent b7e6f8a commit f8655b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/querystream.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ QueryStream.prototype._read = function () {
131131
self._resultSet._getRows(fetchCount, function(err, rows) {
132132
if (err) {
133133
// We'll return the error from getRows, but first try to close the resultSet.
134-
self._resultSet.close(function() {});
134+
// Calling the C layer close directly to avoid assertions on the public method
135+
self._resultSet._close(function() {
136+
self.emit('error', err);
137+
});
135138

136-
self.emit('error', err);
137139
return;
138140
}
139141

0 commit comments

Comments
 (0)