web: send response info when response is thrown
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
a8998a6356
commit
5955394c1d
|
@ -19,10 +19,14 @@ export function configureSentry(): Promise<Config> {
|
|||
],
|
||||
tracesSampleRate: 0.6,
|
||||
environment: config.errorReportingEnvironment,
|
||||
beforeSend(event: Sentry.Event, hint: Sentry.EventHint) {
|
||||
beforeSend: async (event: Sentry.Event, hint: Sentry.EventHint): Promise<Sentry.Event | null> => {
|
||||
if (hint.originalException instanceof SentryIgnoredError) {
|
||||
return null;
|
||||
}
|
||||
if (hint.originalException instanceof Response) {
|
||||
const body = await hint.originalException.json();
|
||||
event.message = `${hint.originalException.status} ${hint.originalException.url}: ${JSON.stringify(body)}`
|
||||
}
|
||||
if (event.exception) {
|
||||
me().then(user => {
|
||||
Sentry.showReportDialog({
|
||||
|
|
Reference in New Issue