mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-26 16:37:50 +01:00
fix(PostgreSQL): better handle connection errors, should fix #794
This commit is contained in:
parent
23c59b4d4e
commit
33bbc0e7e6
@ -210,6 +210,10 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
if (this._params.readonly)
|
if (this._params.readonly)
|
||||||
await connection.query('SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY');
|
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;
|
return connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user