Skip to content

Commit 9921430

Browse files
emilkrebsCopilot
andauthored
Update main.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 33a1ccb commit 9921430

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

main.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,16 @@ if (!serverSecret) {
1414

1515
defaultLogger.log(`Database Path Source: ${databasePath ? 'env' : 'default'}`);
1616

17-
export const noteDatabase: NoteDatabase = await new NoteDatabase(databasePath).init();
17+
let noteDatabase: NoteDatabase;
1818

19+
try {
20+
noteDatabase = await new NoteDatabase(databasePath).init();
21+
} catch (error) {
22+
defaultLogger.error('Failed to initialize NoteDatabase', error);
23+
throw error;
24+
}
25+
26+
export { noteDatabase };
1927
// Configure rate limiter: 15 requests per minute, 5 min block duration
2028
const rateLimiter = new ArcRateLimiter({
2129
maxRequests: 15,

0 commit comments

Comments
 (0)