Skip to content

Commit 51cf643

Browse files
committed
Fixed an issue where no error message was outputted when an error couldn't be parsed.
1 parent b87dcc2 commit 51cf643

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/services/WebErrorParser.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class WebErrorParser implements IErrorParser {
77
public parse(context:EventPluginContext, exception:Error): Promise<IError> {
88
return StackTrace.fromError(exception).then(
99
(stackFrames: StackTrace.StackFrame[]) => this.processError(context, exception, stackFrames),
10-
() => this.onParseError(context)
10+
(error) => this.onParseError(error, context)
1111
);
1212
}
1313

@@ -22,9 +22,11 @@ export class WebErrorParser implements IErrorParser {
2222
return Promise.resolve();
2323
}
2424

25-
private onParseError(context:EventPluginContext): Promise<any> {
25+
private onParseError(error:Error, context:EventPluginContext): Promise<any> {
2626
context.cancel = true;
27-
return Promise.reject(new Error('Unable to parse the exceptions stack trace. This exception will be discarded.'))
27+
var message = 'Unable to parse the exceptions stack trace';
28+
context.log.error(`${message}: ${error.message}`);
29+
return Promise.reject(new Error(`${message}. This exception will be discarded.`))
2830
}
2931

3032
private getStackFrames(context:EventPluginContext, stackFrames:StackTrace.StackFrame[]): IStackFrame[] {

0 commit comments

Comments
 (0)