better error reporting

This commit is contained in:
SPRINX0\prochazka
2024-10-01 12:15:22 +02:00
parent 29a66bfcb0
commit ef23b786ac
23 changed files with 99 additions and 69 deletions

View File

@@ -11,7 +11,7 @@ const processArgs = require('../utility/processArgs');
const { testConnectionPermission } = require('../utility/hasPermission');
const { MissingCredentialsError } = require('../utility/exceptions');
const pipeForkLogs = require('../utility/pipeForkLogs');
const { getLogger } = require('dbgate-tools');
const { getLogger, extractErrorLogData } = require('dbgate-tools');
const logger = getLogger('serverConnection');
@@ -112,7 +112,7 @@ module.exports = {
try {
existing.subprocess.kill();
} catch (err) {
logger.error({ err }, 'Error killing subprocess');
logger.error(extractErrorLogData(err), 'Error killing subprocess');
}
}
this.opened = this.opened.filter(x => x.conid != conid);
@@ -167,7 +167,7 @@ module.exports = {
try {
opened.subprocess.send({ msgtype: 'ping' });
} catch (err) {
logger.error({ err }, 'Error pinging server connection');
logger.error(extractErrorLogData(err), 'Error pinging server connection');
this.close(conid);
}
})
@@ -217,7 +217,7 @@ module.exports = {
try {
conn.subprocess.send({ msgid, ...message });
} catch (err) {
logger.error({ err }, 'Error sending request');
logger.error(extractErrorLogData(err), 'Error sending request');
this.close(conn.conid);
}
});