Skip to content

Commit 5620325

Browse files
committed
forward error from oak to sentry
1 parent dbde6db commit 5620325

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/core/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ if (settings.SENTRY.DSN) {
99
Sentry.init({
1010
dsn: settings.SENTRY.DSN,
1111
});
12+
13+
// Oak handles errors automatically
14+
// So we capture them here so sentry can get them
15+
api.addEventListener("error", (event) => {
16+
Sentry.captureException(event.error);
17+
});
18+
1219
console.info("Sentry initialized");
1320
} else {
1421
console.error("Skipping Sentry initialization, no DSN provided");

0 commit comments

Comments
 (0)