Skip to content

Commit 33617dc

Browse files
committed
don't emit error on command if callback with error was invoked
1 parent e808a83 commit 33617dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/pool.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ Pool.prototype.query = function (sql, values, cb) {
130130

131131
this.getConnection(function (err, conn) {
132132
if (err) {
133-
cmdQuery.emit('error', err);
134133
if (typeof cmdQuery.onResult === 'function') {
135134
cmdQuery.onResult(err);
135+
} else {
136+
cmdQuery.emit('error', err);
136137
}
137138
return;
138139
}

0 commit comments

Comments
 (0)