Skip to content

Commit

Permalink
add cause to our error in Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
jscriptcoder committed Jun 12, 2023
1 parent c1c7463 commit 1c2960c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/bridge-ui/src/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,20 @@ export function setupSentry(dsn: string) {
sampleRate: isProd ? 0.6 : 1.0,
tracesSampleRate: isProd ? 0.6 : 1.0,
maxBreadcrumbs: 50,

beforeSend(event, hint) {
const processedEvent = { ...event };
const { cause } = hint?.originalException as Error;

// If we have "cause", we want to know about it for more context.
if (cause) {
processedEvent.extra = {
...processedEvent.extra,
cause,
};
}

return processedEvent;
},
});
}

0 comments on commit 1c2960c

Please sign in to comment.