mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix(PostgreSQL): better handle connection errors, should fix #794
This commit is contained in:
@ -210,6 +210,10 @@ export class PostgreSQLClient extends BaseClient {
|
||||
if (this._params.readonly)
|
||||
await connection.query('SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY');
|
||||
|
||||
connection.on('error', err => { // Intercepts errors and converts to rejections
|
||||
Promise.reject(err);
|
||||
});
|
||||
|
||||
return connection;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user