Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Antonis Lilis <[email protected]>
  • Loading branch information
krystofwoldrich and antonis authored Oct 14, 2024
1 parent a371274 commit 9ed26d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export const NATIVE: SentryNativeWrapper = {
const normalizedExtra = normalize(extra);
stringifiedExtra = JSON.stringify(normalizedExtra);
} catch (e) {
logger.error('Extra not passed to native SDK, because it contains non-stringifiable values', e);
logger.error('Extra for key ${key} not passed to native SDK, because it contains non-stringifiable values', e);
}

if (typeof stringifiedExtra === 'string') {
Expand Down Expand Up @@ -473,7 +473,7 @@ export const NATIVE: SentryNativeWrapper = {
try {
normalizedContext = convertToNormalizedObject(context);
} catch (e) {
logger.error('Context not passed to native SDK, because it contains non-serializable values', e);
logger.error('Context for key ${key} not passed to native SDK, because it contains non-serializable values', e);
}

if (normalizedContext) {
Expand Down
2 changes: 2 additions & 0 deletions test/wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ describe('Tests Native Wrapper', () => {
test('handles null value by passing null to native method', () => {
NATIVE.setContext('key', null);
expect(RNSentry.setContext).toHaveBeenCalledWith('key', null);
expect(RNSentry.setContext).toHaveBeenCalledOnce();
});

test('handles undefined value by converting to object with "value" key', () => {
Expand All @@ -737,6 +738,7 @@ describe('Tests Native Wrapper', () => {
circular.self = circular;
NATIVE.setContext('key', circular);
expect(RNSentry.setContext).toHaveBeenCalledWith('key', { self: '[Circular ~]' });
expect(RNSentry.setContext).toHaveBeenCalledOnce();
});
});
});

0 comments on commit 9ed26d0

Please sign in to comment.