From ef124d689e38f2ac05d7e479b9e3f511b8c3da17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 7 Dec 2016 16:22:21 +0100 Subject: [PATCH] Handle query end in `error` listener since pg no longer emits `end` if and error occurs --- app/models/formats/pg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/formats/pg.js b/app/models/formats/pg.js index c9eb3e17..fd3955b3 100644 --- a/app/models/formats/pg.js +++ b/app/models/formats/pg.js @@ -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);