maintain req error handler

This commit is contained in:
Simon Martín 2018-08-10 14:38:24 +02:00
parent 319b64e20c
commit 9eeeadbc07

View File

@ -115,6 +115,10 @@ function handleCopyFrom (logger) {
req
.on('data', data => isGzip ? metrics.addGzipSize(data.length) : undefined)
.on('error', err => {
metrics.end(null, err);
pgstream.emit('error', err);
})
.on('close', () => {
const err = new Error('Connection closed by client');
pgstream.emit('cancelQuery', err);