Skip to content

Commit 7bbd283

Browse files
wong2HazAT
authored andcommitted
Serialize error object with message in ExtraErrorData integration (getsentry#1958)
1 parent ecf2bc1 commit 7bbd283

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/integrations/src/extraerrordata.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class ExtraErrorData implements Integration {
8585
for (const key of errorKeys) {
8686
let value = error[key];
8787
if (isError(value)) {
88-
value = (value as Error).name || (value as Error).constructor.name;
88+
value = (value as Error).toString();
8989
}
9090
// tslint:disable:no-unsafe-any
9191
extraErrorInfo[key] = value;

packages/integrations/test/extraerrordata.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('ExtraErrorData()', () => {
3737

3838
expect(enhancedEvent.extra).toEqual({
3939
TypeError: {
40-
cause: 'SyntaxError',
40+
cause: 'SyntaxError: bar',
4141
},
4242
});
4343
});

0 commit comments

Comments
 (0)