(evt: Event)
| 61 | } |
| 62 | |
| 63 | function formatEventRejection(evt: Event): string { |
| 64 | const targetName = evt.target?.constructor?.name ?? 'unknown'; |
| 65 | let message = `Event rejection: type="${evt.type}", target="${targetName}"`; |
| 66 | |
| 67 | if ('detail' in evt && evt.detail !== undefined) { |
| 68 | try { |
| 69 | message += `, detail=${JSON.stringify(evt.detail)}`; |
| 70 | } catch { |
| 71 | message += ', detail=[Unserializable]'; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | return message; |
| 76 | } |
| 77 | |
| 78 | export function SetupSentry() { |
| 79 | if (options.statusTrackingEnabled && options.sentryDsn) { |