Skip to content

Commit

Permalink
Catch uncaught exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNjunge committed Jun 2, 2024
1 parent 7106df3 commit c0be755
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ async function enablePlugins(app: NestFastifyApplication): Promise<void> {
});
}

process.on("uncaughtException", (e, origin) => {
logger.error(`${origin}: ${e.message}`, {}, e);
});

function initializeSwagger(app: NestFastifyApplication): void {
if (!bool(config.swagger.enabled)) {
return;
Expand Down

0 comments on commit c0be755

Please sign in to comment.