Skip to content

Commit c9f9caf

Browse files
committed
Fix brianc#2556 (handleRowDescription of null) by keeping callback errors from interfering with cleanup
1 parent 28ac2a1 commit c9f9caf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: packages/pg/lib/query.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,14 @@ class Query extends EventEmitter {
135135
return this.handleError(this._canceledDueToError, con)
136136
}
137137
if (this.callback) {
138-
this.callback(null, this._results)
138+
try {
139+
this.callback(null, this._results)
140+
}
141+
catch(err) {
142+
process.nextTick(() => {
143+
throw err
144+
})
145+
}
139146
}
140147
this.emit('end', this._results)
141148
}

0 commit comments

Comments
 (0)