File tree 3 files changed +6
-4
lines changed
integration-common-inboundfilters/src
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ import { collectIntegrations } from './integrations';
62
62
* // ...
63
63
* }
64
64
*/
65
- // TODO: Allow for passing scope during construction for explicit `this._scope`
66
65
export abstract class BaseClient < O extends Options > implements ClientLike < O > {
67
66
/** Options passed to the SDK. */
68
67
public readonly options : O ;
@@ -79,7 +78,7 @@ export abstract class BaseClient<O extends Options> implements ClientLike<O> {
79
78
80
79
protected _lastEventId ?: string ;
81
80
82
- protected _scope : ScopeLike = new Scope ( ) ;
81
+ protected _scope : ScopeLike ;
83
82
84
83
protected _eventProcessors : EventProcessor [ ] = [ ] ;
85
84
@@ -101,6 +100,7 @@ export abstract class BaseClient<O extends Options> implements ClientLike<O> {
101
100
this . logger . enabled = true ;
102
101
}
103
102
103
+ this . _scope = this . options . _internal ?. scope || new Scope ( ) ;
104
104
this . _transport = this . _setupTransport ( ) ;
105
105
this . _integrations = this . _setupIntegrations ( ) ;
106
106
}
Original file line number Diff line number Diff line change @@ -94,9 +94,9 @@ export class InboundFilters implements Integration {
94
94
return false ;
95
95
}
96
96
97
+ const { ignoreErrors } = options ;
97
98
return this . _getPossibleEventMessages ( event ) . some ( message =>
98
- // Not sure why TypeScript complains here...
99
- ( options . ignoreErrors as Array < RegExp | string > ) . some ( pattern => isMatchingPattern ( message , pattern ) ) ,
99
+ ignoreErrors . some ( pattern => isMatchingPattern ( message , pattern ) ) ,
100
100
) ;
101
101
}
102
102
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Breadcrumb, BreadcrumbHint } from './breadcrumb';
2
2
import { SentryEvent , EventHint } from './event' ;
3
3
import { Integration } from './integration' ;
4
4
import { LogLevel } from './loglevel' ;
5
+ import { ScopeLike } from './scope' ;
5
6
import { SdkInfo } from './sdkinfo' ;
6
7
import { SamplingContext } from './transaction' ;
7
8
import { Transport , TransportOptions } from './transport' ;
@@ -130,6 +131,7 @@ export interface Options {
130
131
131
132
_internal ?: {
132
133
sdk ?: SdkInfo ;
134
+ scope ?: ScopeLike ;
133
135
defaultIntegrations ?: Integration [ ] ;
134
136
discoveredIntegrations ?: Integration [ ] ;
135
137
} ;
You can’t perform that action at this time.
0 commit comments