@@ -2,7 +2,7 @@ import { BaseBackend, Options, SentryError } from '@sentry/core';
22import { SentryEvent , SentryEventHint , Severity , Transport } from '@sentry/types' ;
33import { isDOMError , isDOMException , isError , isErrorEvent , isPlainObject } from '@sentry/utils/is' ;
44import { supportsBeacon , supportsFetch } from '@sentry/utils/supports' ;
5- import { eventFromPlainObject , eventFromStacktrace , prepareFramesForEvent } from './parsers' ;
5+ import { addExceptionTypeValue , eventFromPlainObject , eventFromStacktrace , prepareFramesForEvent } from './parsers' ;
66import { computeStackTrace } from './tracekit' ;
77import { BeaconTransport , FetchTransport , XHRTransport } from './transports' ;
88
@@ -87,6 +87,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
8787 const message = ex . message ? `${ name } : ${ ex . message } ` : name ;
8888
8989 event = await this . eventFromMessage ( message , undefined , hint ) ;
90+ addExceptionTypeValue ( event , message ) ;
9091 } else if ( isError ( exception as Error ) ) {
9192 // we have a real Error object, do nothing
9293 event = eventFromStacktrace ( computeStackTrace ( exception as Error ) ) ;
@@ -96,6 +97,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
9697 // which is much better than creating new group when any key/value change
9798 const ex = exception as { } ;
9899 event = eventFromPlainObject ( ex , hint . syntheticException ) ;
100+ addExceptionTypeValue ( event , 'Custom Object' ) ;
99101 } else {
100102 // If none of previous checks were valid, then it means that
101103 // it's not a DOMError/DOMException
@@ -105,6 +107,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
105107 // So bail out and capture it as a simple message:
106108 const ex = exception as string ;
107109 event = await this . eventFromMessage ( ex , undefined , hint ) ;
110+ addExceptionTypeValue ( event , `${ ex } ` ) ;
108111 }
109112
110113 event = {
0 commit comments