1
1
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:
Fabio Di Stasio 2024-04-30 18:06:11 +02:00
parent 23c59b4d4e
commit 33bbc0e7e6

View File

@ -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;
} }