N
Nuxt9mo ago
RicharDVD

Check if error page has loaded

Hi all, I'm currently implementing the Sentry report dialog modal. I have a client plugin that initializes and configures Sentry. In here I have configured that the report dialog will be shown if there is an exception before sending the event to Sentry. It works fine but it now shows it on all errors (even silent ones). I would want it to only show when the error page is loaded. How can I check in a client plugin if the error page has loaded? My basic setup is like the following:
export default defineNuxtPlugin((nuxtApp) => {
...
Sentry.init({
...,
integrations: [
Sentry.feedbackIntegration({
....
});
],
beforeSend(event) {
// I would also like to check if error page has loaded
if(event.exception && event.event_id) {
Sentry.showReportDialog({
eventId: event.event_id
.....
})
}
return event;
}
})
});
export default defineNuxtPlugin((nuxtApp) => {
...
Sentry.init({
...,
integrations: [
Sentry.feedbackIntegration({
....
});
],
beforeSend(event) {
// I would also like to check if error page has loaded
if(event.exception && event.event_id) {
Sentry.showReportDialog({
eventId: event.event_id
.....
})
}
return event;
}
})
});
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server