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
23 lines (19 loc) · 798 Bytes
/
ModuleInfoPlugin.ts
File metadata and controls
23 lines (19 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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';
public run(context:EventPluginContext, next?:() => void): void {
const error:string = '@error'; // optimization for minifier.
var collector = context.client.config.moduleCollector;
if (context.event.data[error] && !context.event.data['@error'].modules && !!collector) {
var modules = collector.getModules(context);
if (modules && modules.length > 0) {
context.event.data[error].modules = modules;
}
}
next && next();
}
}