forked from exceptionless/Exceptionless.JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleInfoPlugin.ts
More file actions
25 lines (21 loc) · 800 Bytes
/
ModuleInfoPlugin.ts
File metadata and controls
25 lines (21 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { IEventPlugin } from '../IEventPlugin';
import { EventPluginContext } from '../EventPluginContext';
import { IModule } from '../../models/IModule';
import { Utils } from '../../Utils';
export class ModuleInfoPlugin implements IEventPlugin {
public priority:number = 40;
public name:string = 'ModuleInfoPlugin';
run(context:EventPluginContext):Promise<any> {
if (!context.event.data ||
!context.event.data['@error'] ||
!!context.event.data['@error'].modules ||
!context.client.config.moduleCollector) {
return Promise.resolve();
}
var modules = context.client.config.moduleCollector.getModules(context);
if (modules && modules.length > 0) {
context.event.data['@error'].modules = modules;
}
return Promise.resolve();
}
}