Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
feat(stringify): stringify otherData in formatErrorReport (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Singleton authored Jun 4, 2020
1 parent 76b4468 commit 1788863
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions __tests__/errorReporting.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ describe('error reporting', () => {
msg: testError.message,
stack: testError.stack,
href: 'about:blank',
otherData: { ...otherData },
otherData: JSON.stringify({ ...otherData }),
},
];

Expand Down Expand Up @@ -489,7 +489,8 @@ describe('error reporting', () => {
it('should include other data given', () => {
const otherData = { foo: 'bar' };
const result = formatErrorReport(testError, otherData);
expect(result.otherData).toBe(otherData);

expect(result.otherData).toBe(JSON.stringify(otherData));
});
});
});
2 changes: 1 addition & 1 deletion src/errorReporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function formatErrorReport(error, otherData) {
// TODO: use StackTrace to format the stack?
stack: error && error.stack, // IE >= 10
href: global.BROWSER ? global.location.href : undefined,
otherData,
otherData: JSON.stringify(otherData),
};
}

Expand Down

0 comments on commit 1788863

Please sign in to comment.