Skip to content

Commit a341518

Browse files
committed
Fix pool.query not emitting connection errors
fixes #941
1 parent c244a56 commit a341518

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Changes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This file is a manually maintained list of changes for each release. Feel free
44
to add your changes here when sending pull requests. Also send corrections if
55
you spot any mistakes.
66

7+
## HEAD
8+
9+
* Fix `pool.query` streaming interface not emitting connection errors #941
10+
711
## v2.5.2 (2014-10-10)
812

913
* Fix receiving large text fields #922

lib/Pool.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ Pool.prototype.query = function (sql, values, cb) {
182182

183183
this.getConnection(function (err, conn) {
184184
if (err) {
185-
var cb = query._callback;
186-
cb && cb(err);
185+
query.on('error', function () {});
186+
query.end(err);
187187
return;
188188
}
189189

0 commit comments

Comments
 (0)