Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix(errors): catch uncaughtExceptions from the process and increment …
Browse files Browse the repository at this point in the history
…counter, replace koa app error catching
  • Loading branch information
dtfiedler committed Sep 15, 2023
1 parent b329071 commit a208048
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ const errorCounter = new promClient.Counter({
help: 'Total error count',
});

// TODO: add error metrics
app.on('error', (err) => {
process.on('uncaughtException', (err) => {
logger.error(err);
errorCounter.inc();
});
})

const serverConfigs = {
port: +(process.env.PORT || 3000),
Expand Down

0 comments on commit a208048

Please sign in to comment.