Skip to content

Commit

Permalink
fix(PostgreSQL): unhandled error on connection lost, fixes #740
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Dec 29, 2023
1 parent 23946ff commit cdd2a11
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/libs/clients/PostgreSQLClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit cdd2a11

Please sign in to comment.