summaryrefslogtreecommitdiff
path: root/packages/backend/src/boot
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/boot')
-rw-r--r--packages/backend/src/boot/entry.ts16
-rw-r--r--packages/backend/src/boot/master.ts2
2 files changed, 13 insertions, 5 deletions
diff --git a/packages/backend/src/boot/entry.ts b/packages/backend/src/boot/entry.ts
index 735a0f4666..e52d77ab9b 100644
--- a/packages/backend/src/boot/entry.ts
+++ b/packages/backend/src/boot/entry.ts
@@ -9,6 +9,7 @@
import cluster from 'node:cluster';
import { EventEmitter } from 'node:events';
+import { inspect } from 'node:util';
import chalk from 'chalk';
import Xev from 'xev';
import Logger from '@/logger.js';
@@ -53,15 +54,22 @@ async function main() {
// Display detail of unhandled promise rejection
if (!envOption.quiet) {
- process.on('unhandledRejection', console.dir);
+ process.on('unhandledRejection', e => {
+ try {
+ logger.error('Unhandled rejection:', inspect(e));
+ } catch {
+ console.error('Unhandled rejection:', inspect(e));
+ }
+ });
}
// Display detail of uncaught exception
process.on('uncaughtException', err => {
try {
- logger.error(err);
- console.trace(err);
- } catch { }
+ logger.error('Uncaught exception:', err);
+ } catch {
+ console.error('Uncaught exception:', err);
+ }
});
// Dying away...
diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts
index 538c529106..301db03e0e 100644
--- a/packages/backend/src/boot/master.ts
+++ b/packages/backend/src/boot/master.ts
@@ -172,7 +172,7 @@ function loadConfigBoot(): Config {
config = loadConfig();
} catch (exception) {
if (typeof exception === 'string') {
- configLogger.error(exception);
+ configLogger.error('Exception loading config:', exception);
process.exit(1);
} else if ((exception as any).code === 'ENOENT') {
configLogger.error('Configuration file not found', null, true);