Skip to content

Commit 21a449b

Browse files
Tommatheussenkamilogorek
authored andcommitted
feat: Add Sentry eventID to the response object (getsentry#1890)
Sets the eventId returned from captureException on ExpressJS middleware. This allows us to use the eventId to inform the user of a tracking ID they can use when in contact with Helpdesk. Implements behaviour as shown in https://docs.sentry.io/platforms/node/express/ Likely an oversight that was missed when moving from Raven to the new clients?
1 parent eeab4c1 commit 21a449b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/node/src/handlers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ export function errorHandler(): (
271271
next(error);
272272
return;
273273
}
274-
captureException(error);
274+
const eventId = captureException(error);
275+
_res.sentry = eventId;
275276
next(error);
276277
};
277278
}

0 commit comments

Comments
 (0)