Skip to content

Commit

Permalink
Serialize error object with message in ExtraErrorData integration (#1958
Browse files Browse the repository at this point in the history
)
  • Loading branch information
wong2 authored and HazAT committed Mar 26, 2019
1 parent ecf2bc1 commit 7bbd283
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/integrations/src/extraerrordata.ts
Expand Up @@ -85,7 +85,7 @@ export class ExtraErrorData implements Integration {
for (const key of errorKeys) {
let value = error[key];
if (isError(value)) {
value = (value as Error).name || (value as Error).constructor.name;
value = (value as Error).toString();
}
// tslint:disable:no-unsafe-any
extraErrorInfo[key] = value;
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/test/extraerrordata.test.ts
Expand Up @@ -37,7 +37,7 @@ describe('ExtraErrorData()', () => {

expect(enhancedEvent.extra).toEqual({
TypeError: {
cause: 'SyntaxError',
cause: 'SyntaxError: bar',
},
});
});
Expand Down

0 comments on commit 7bbd283

Please sign in to comment.