Skip to content

Commit 176f2ce

Browse files
committed
Kill if db can't connect
1 parent 9e3d059 commit 176f2ce

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ async function init() {
1212
process.exit(1);
1313
});
1414

15-
await initDb();
15+
try {
16+
await initDb();
17+
} catch (e) {
18+
Logger.error(`Init Db: ${e}`);
19+
process.exit(1);
20+
}
21+
1622
// edge case clause for creating compatible .db files, do not enable
1723
if (config.mode === "init-db-and-exit") process.exit(0);
1824
// do not enable init-db-only mode for usage.
@@ -27,4 +33,4 @@ async function init() {
2733
}).setTimeout(15000);
2834
}
2935

30-
init().catch((err) => Logger.error(err));
36+
init().catch((err) => Logger.error(`Index.js: ${err}`));

0 commit comments

Comments
 (0)