Handle query end in error listener since pg no longer emits end if and error occurs

This commit is contained in:
Daniel García Aubert 2016-12-07 16:22:21 +01:00
parent c65124fc37
commit ef124d689e

View File

@ -139,12 +139,13 @@ PostgresFormat.prototype.sendResponse = function(opts, callback) {
query.on('error', function(err) {
that.error = err;
if (err.message && err.message.match(/row too large, was \d* bytes/i)) {
console.error(JSON.stringify({
return console.error(JSON.stringify({
username: opts.username,
type: 'row_size_limit_exceeded',
error: err.message
}));
}
that.handleQueryEnd();
});
query.on('notice', function(msg) {
that.handleNotice(msg, query._result);