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,
|
tracesSampleRate: 0.6,
|
||||||
environment: config.errorReportingEnvironment,
|
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) {
|
if (hint.originalException instanceof SentryIgnoredError) {
|
||||||
return null;
|
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) {
|
if (event.exception) {
|
||||||
me().then(user => {
|
me().then(user => {
|
||||||
Sentry.showReportDialog({
|
Sentry.showReportDialog({
|
||||||
|
|
Reference in New Issue