Skip to content

Commit b65d2bb

Browse files
committed
Specify a default error type.
1 parent fca9d45 commit b65d2bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/services/DefaultErrorParser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class DefaultErrorParser implements IErrorParser {
4747

4848
const message = typeof(exception) === 'string' ? exception as any : undefined;
4949
return {
50-
type: stackTrace.name,
50+
type: stackTrace.name || 'Error',
5151
message: stackTrace.message || exception.message || message,
5252
stack_trace: getStackFrames(stackTrace.stack || [])
5353
};

src/services/NodeErrorParser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class NodeErrorParser implements IErrorParser {
3333

3434
const stackFrames = nodestacktrace.parse(exception) || [];
3535
return {
36-
type: exception.name,
36+
type: exception.name || 'Error',
3737
message: exception.message,
3838
stack_trace: getStackFrames(stackFrames)
3939
};

0 commit comments

Comments
 (0)