Adds additional context to true send errors (#667)

This commit is contained in:
Chris Anderson 2025-04-29 18:59:40 -05:00 committed by GitHub
parent 02b0b4f1aa
commit 3d59d28fff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -25,7 +25,9 @@ export default class SentryProvider implements ErrorHandlingProvider {
})
}
notify(error: Error) {
Sentry.captureException(error)
notify(error: Error, context?: Record<string, any>) {
Sentry.captureException(error, {
extra: context,
})
}
}

View file

@ -193,7 +193,7 @@ export const failSend = async ({ campaign, user, context }: MessageTriggerHydrat
}
// Notify of the error if it's a critical one
if (error && shouldNotify(error)) App.main.error.notify(error)
if (error && shouldNotify(error)) App.main.error.notify(error, context)
}
export const finalizeSend = async (data: MessageTriggerHydrated<TemplateType>, result: any) => {