fix(PostgreSQL): unhandled error on connection lost, fixes #740

This commit is contained in:
Fabio Di Stasio 2023-12-29 14:42:12 +01:00
parent 23946ff2ce
commit cdd2a11f8e
1 changed files with 4 additions and 0 deletions

View File

@ -232,6 +232,10 @@ export class PostgreSQLClient extends BaseClient {
await this.keepAlive();
}, this._keepaliveMs);
connection.on('error', err => { // Intercepts errors and converts to rejections
Promise.reject(err);
});
return connection;
}