copy to: manage error in 1 point
This commit is contained in:
parent
1dac5355d1
commit
e39a9b2bf7
@ -89,17 +89,10 @@ function handleCopyTo (logger) {
|
||||
.on('close', () => {
|
||||
const err = new Error('Connection closed by client');
|
||||
pgstream.emit('cancelQuery', err);
|
||||
|
||||
metrics.end(null, err);
|
||||
pgstream.unpipe();
|
||||
|
||||
return next(err);
|
||||
pgstream.emit('error', err);
|
||||
})
|
||||
.on('error', err => {
|
||||
metrics.end(null, err);
|
||||
pgstream.unpipe();
|
||||
|
||||
return next(err);
|
||||
pgstream.emit('error', err);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user