Skip to content

Commit

Permalink
Fix TS errors after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
codykaup committed Oct 2, 2024
1 parent 9280401 commit e4e0a70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions node-src/errorMonitoring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ describe('filterErrorEvent', () => {
const actual = filterErrorEvent({
exception: { values: [{ value: redError }, { value: redError }] },
} as Sentry.ErrorEvent);
expect(actual.exception.values[0].value).toBe('error');
expect(actual.exception.values[1].value).toBe('error');
expect(actual.exception?.values?.[0].value).toBe('error');
expect(actual.exception?.values?.[1].value).toBe('error');
});
});

Expand All @@ -34,7 +34,7 @@ describe('filterBreadcrumb', () => {
category: 'console',
message: blueMessage,
} as Sentry.Breadcrumb);
expect(actual.message).toBe('message');
expect(actual?.message).toBe('message');
});

it('returns null for empty console breadcrumbs', () => {
Expand Down
4 changes: 3 additions & 1 deletion node-src/errorMonitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export function filterErrorEvent(event: Sentry.ErrorEvent) {
// And from exception messages
if (event.exception?.values) {
for (const [index, exception] of event.exception.values.entries()) {
event.exception.values[index].value = stripAnsi(exception.value);
if (exception.value) {
event.exception.values[index].value = stripAnsi(exception.value);
}
}
}
return event;
Expand Down

0 comments on commit e4e0a70

Please sign in to comment.