Skip to content

Commit

Permalink
fix: Set transaction on scope in node for request
Browse files Browse the repository at this point in the history
  • Loading branch information
HazAT committed Jul 23, 2020
1 parent aa60eea commit 04c2b04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/node/src/handlers.ts
Expand Up @@ -407,6 +407,11 @@ export function errorHandler(options?: {

if (shouldHandleError(error)) {
withScope(_scope => {
// For some reason we need to set the transaction on the scope again
const transaction = (res as any).__sentry_transaction as Span;
if (transaction && _scope.getSpan() === undefined) {
_scope.setSpan(transaction);
}
const eventId = captureException(error);
(res as any).sentry = eventId;
next(error);
Expand Down

0 comments on commit 04c2b04

Please sign in to comment.