Skip to content

Commit

Permalink
fix(server): handle error
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Jun 11, 2024
1 parent 4665c5a commit eedd93f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ app.get('/', async (c) => {
timestamp: (await getRefreshTimestamp(storage)).toISOString()
});
});

app.onError((err, c) => {
logger.error(null, err.message);

c.status(500);
return c.json({ status: 'ERROR' });
});

0 comments on commit eedd93f

Please sign in to comment.