File tree 3 files changed +31
-18
lines changed
packages/deno/src/integrations
3 files changed +31
-18
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,12 @@ export class DenoContext implements Integration {
58
58
public name : string = DenoContext . id ;
59
59
60
60
/** @inheritDoc */
61
- public setupOnce ( addGlobalEventProcessor : ( callback : EventProcessor ) => void ) : void {
62
- addGlobalEventProcessor ( async ( event : Event ) => denoRuntime ( event ) ) ;
61
+ public setupOnce ( _addGlobalEventProcessor : ( callback : EventProcessor ) => void ) : void {
62
+ // noop
63
+ }
64
+
65
+ /** @inheritDoc */
66
+ public processEvent ( event : Event ) : Promise < Event > {
67
+ return denoRuntime ( event ) ;
63
68
}
64
69
}
Original file line number Diff line number Diff line change @@ -67,8 +67,13 @@ export class ContextLines implements Integration {
67
67
/**
68
68
* @inheritDoc
69
69
*/
70
- public setupOnce ( addGlobalEventProcessor : ( callback : EventProcessor ) => void ) : void {
71
- addGlobalEventProcessor ( event => this . addSourceContext ( event ) ) ;
70
+ public setupOnce ( _addGlobalEventProcessor : ( callback : EventProcessor ) => void ) : void {
71
+ // noop
72
+ }
73
+
74
+ /** @inheritDoc */
75
+ public processEvent ( event : Event ) : Promise < Event > {
76
+ return this . addSourceContext ( event ) ;
72
77
}
73
78
74
79
/** Processes an event and adds context lines */
Original file line number Diff line number Diff line change @@ -72,29 +72,32 @@ export class NormalizePaths implements Integration {
72
72
public name : string = NormalizePaths . id ;
73
73
74
74
/** @inheritDoc */
75
- public setupOnce ( addGlobalEventProcessor : ( callback : EventProcessor ) => void ) : void {
75
+ public setupOnce ( _addGlobalEventProcessor : ( callback : EventProcessor ) => void ) : void {
76
+ // noop
77
+ }
78
+
79
+ /** @inheritDoc */
80
+ public processEvent ( event : Event ) : Event | null {
76
81
// This error.stack hopefully contains paths that traverse the app cwd
77
82
const error = new Error ( ) ;
78
83
79
- addGlobalEventProcessor ( ( event : Event ) : Event | null => {
80
- const appRoot = getAppRoot ( error ) ;
84
+ const appRoot = getAppRoot ( error ) ;
81
85
82
- if ( appRoot ) {
83
- for ( const exception of event . exception ?. values || [ ] ) {
84
- for ( const frame of exception . stacktrace ?. frames || [ ] ) {
85
- if ( frame . filename && frame . in_app ) {
86
- const startIndex = frame . filename . indexOf ( appRoot ) ;
86
+ if ( appRoot ) {
87
+ for ( const exception of event . exception ?. values || [ ] ) {
88
+ for ( const frame of exception . stacktrace ?. frames || [ ] ) {
89
+ if ( frame . filename && frame . in_app ) {
90
+ const startIndex = frame . filename . indexOf ( appRoot ) ;
87
91
88
- if ( startIndex > - 1 ) {
89
- const endIndex = startIndex + appRoot . length ;
90
- frame . filename = `app://${ frame . filename . substring ( endIndex ) } ` ;
91
- }
92
+ if ( startIndex > - 1 ) {
93
+ const endIndex = startIndex + appRoot . length ;
94
+ frame . filename = `app://${ frame . filename . substring ( endIndex ) } ` ;
92
95
}
93
96
}
94
97
}
95
98
}
99
+ }
96
100
97
- return event ;
98
- } ) ;
101
+ return event ;
99
102
}
100
103
}
You can’t perform that action at this time.
0 commit comments