better connection error reporting

This commit is contained in:
SPRINX0\prochazka
2025-02-14 13:27:56 +01:00
parent d49c7d5e45
commit 30037dad83
3 changed files with 11 additions and 2 deletions

View File

@@ -71,6 +71,11 @@ module.exports = {
handle_error(conid, database, props) {
const { error } = props;
logger.error(`Error in database connection ${conid}, database ${database}: ${error}`);
if (props?.msgid) {
const [resolve, reject] = this.requests[props?.msgid];
reject(error);
delete this.requests[props?.msgid];
}
},
handle_response(conid, database, { msgid, ...response }) {
const [resolve, reject] = this.requests[msgid];