Skip to content

Commit

Permalink
Include DIM version in sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis committed Oct 15, 2024
1 parent 2cd72a6 commit 0b773a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ app.post('/loadout_share', loadoutShareHandler);
const errorHandler: ErrorRequestHandler = (err, req, res, _next) => {
const dimApp = req.dimApp as ApiApp | undefined;
const user = req.user as UserInfo | undefined;
Sentry.captureException(err, { tags: { dimApp: dimApp?.id, user: user?.bungieMembershipId } });
const dimVersion = req.headers['x-dim-version']?.[0];
Sentry.captureException(err, {
tags: { dimApp: dimApp?.id, user: user?.bungieMembershipId, dimVersion },
});
// Allow any origin to see the response
res.header('Access-Control-Allow-Origin', '*');
if (err instanceof Error && err.name === 'UnauthorizedError') {
Expand Down

0 comments on commit 0b773a8

Please sign in to comment.