@@ -36,16 +36,18 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
36
36
/**
37
37
* @inheritdoc
38
38
*/
39
- protected setupTransport ( ) : Transport {
40
- if ( ! this . options . dsn ) {
39
+ protected _setupTransport ( ) : Transport {
40
+ if ( ! this . _options . dsn ) {
41
41
// We return the noop transport here in case there is no Dsn.
42
- return super . setupTransport ( ) ;
42
+ return super . _setupTransport ( ) ;
43
43
}
44
44
45
- const transportOptions = this . options . transportOptions ? this . options . transportOptions : { dsn : this . options . dsn } ;
45
+ const transportOptions = this . _options . transportOptions
46
+ ? this . _options . transportOptions
47
+ : { dsn : this . _options . dsn } ;
46
48
47
- if ( this . options . transport ) {
48
- return new this . options . transport ( transportOptions ) ;
49
+ if ( this . _options . transport ) {
50
+ return new this . _options . transport ( transportOptions ) ;
49
51
} else if ( supportsBeacon ( ) ) {
50
52
return new BeaconTransport ( transportOptions ) ;
51
53
} else if ( supportsFetch ( ) ) {
@@ -65,7 +67,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
65
67
const errorEvent = exception as ErrorEvent ;
66
68
exception = errorEvent . error ; // tslint:disable-line:no-parameter-reassignment
67
69
event = eventFromStacktrace ( computeStackTrace ( exception as Error ) ) ;
68
- return SyncPromise . resolve ( this . buildEvent ( event , hint ) ) ;
70
+ return SyncPromise . resolve ( this . _buildEvent ( event , hint ) ) ;
69
71
} else if ( isDOMError ( exception as DOMError ) || isDOMException ( exception as DOMException ) ) {
70
72
// If it is a DOMError or DOMException (which are legacy APIs, but still supported in some browsers)
71
73
// then we just extract the name and message, as they don't provide anything else
@@ -77,12 +79,12 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
77
79
78
80
return this . eventFromMessage ( message , Severity . Error , hint ) . then ( messageEvent => {
79
81
addExceptionTypeValue ( messageEvent , message ) ;
80
- return SyncPromise . resolve ( this . buildEvent ( messageEvent , hint ) ) ;
82
+ return SyncPromise . resolve ( this . _buildEvent ( messageEvent , hint ) ) ;
81
83
} ) ;
82
84
} else if ( isError ( exception as Error ) ) {
83
85
// we have a real Error object, do nothing
84
86
event = eventFromStacktrace ( computeStackTrace ( exception as Error ) ) ;
85
- return SyncPromise . resolve ( this . buildEvent ( event , hint ) ) ;
87
+ return SyncPromise . resolve ( this . _buildEvent ( event , hint ) ) ;
86
88
} else if ( isPlainObject ( exception as { } ) && hint && hint . syntheticException ) {
87
89
// If it is plain Object, serialize it manually and extract options
88
90
// This will allow us to group events based on top-level keys
@@ -94,7 +96,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
94
96
synthetic : true ,
95
97
type : 'generic' ,
96
98
} ) ;
97
- return SyncPromise . resolve ( this . buildEvent ( event , hint ) ) ;
99
+ return SyncPromise . resolve ( this . _buildEvent ( event , hint ) ) ;
98
100
}
99
101
100
102
// If none of previous checks were valid, then it means that
@@ -110,14 +112,14 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
110
112
synthetic : true ,
111
113
type : 'generic' ,
112
114
} ) ;
113
- return SyncPromise . resolve ( this . buildEvent ( messageEvent , hint ) ) ;
115
+ return SyncPromise . resolve ( this . _buildEvent ( messageEvent , hint ) ) ;
114
116
} ) ;
115
117
}
116
118
117
119
/**
118
120
* This is an internal helper function that creates an event.
119
121
*/
120
- private buildEvent ( event : Event , hint ?: EventHint ) : Event {
122
+ private _buildEvent ( event : Event , hint ?: EventHint ) : Event {
121
123
return {
122
124
...event ,
123
125
event_id : hint && hint . event_id ,
@@ -134,7 +136,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
134
136
message,
135
137
} ;
136
138
137
- if ( this . options . attachStacktrace && hint && hint . syntheticException ) {
139
+ if ( this . _options . attachStacktrace && hint && hint . syntheticException ) {
138
140
const stacktrace = computeStackTrace ( hint . syntheticException ) ;
139
141
const frames = prepareFramesForEvent ( stacktrace . stack ) ;
140
142
event . stacktrace = {
0 commit comments