Skip to content

Conversation

@philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Nov 4, 2025

📜 Description

Send no exception value when the NSException has no reason.

Then we can easily change (No error message) in the SentryUI to anything we want for NSExceptions, if required. I think the (No error message) is already better.

I plan on removing the Application threw exception NSException via NSException raise: string in an upcoming PR cause it's a bit confusing to add this extra string without much value. Instead, we should only have NSException type and value.

NSString *crashType = [errorReport objectForKey:@SentryCrashField_Type];
if ([crashType isEqualToString:@SentryCrashExcType_NSException]) {
NSDictionary *exception = [errorReport objectForKey:@SentryCrashField_NSException];
NSString *name = [exception objectForKey:@SentryCrashField_Name];
NSString *reason = [exception objectForKey:@SentryCrashField_Reason]
? [exception objectForKey:@SentryCrashField_Reason]
: [errorReport objectForKey:@SentryCrashField_Reason];
return [NSString stringWithFormat:@"Application threw exception %@: %@", name, reason];
}

💡 Motivation and Context

Fixes GH-3706

💚 How did you test it?

Unit tests and macOS sample app

Before After
Screenshot 2025-11-04 at 10 57 55 Screenshot 2025-11-04 at 10 58 18

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Send no exception value when the NSException has no reason.

Fixes GH-3706
Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cursor[bot]

This comment was marked as outdated.

@philipphofmann philipphofmann enabled auto-merge (squash) November 4, 2025 10:27
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1223.18 ms 1262.87 ms 39.69 ms
Size 23.75 KiB 1023.78 KiB 1000.03 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
9264ee8 1233.15 ms 1250.02 ms 16.87 ms
d72784d 1214.31 ms 1241.35 ms 27.04 ms
8da82b4 1220.08 ms 1248.24 ms 28.16 ms
43597ba 1214.88 ms 1243.52 ms 28.65 ms
3cdbc22 1231.63 ms 1251.06 ms 19.43 ms
bbe6658 1221.00 ms 1248.51 ms 27.51 ms
00d9740 1223.53 ms 1249.75 ms 26.22 ms
3067c23 1230.48 ms 1257.90 ms 27.42 ms
cc7f629 1226.00 ms 1245.51 ms 19.51 ms
748df9d 1231.63 ms 1259.47 ms 27.84 ms

App size

Revision Plain With Sentry Diff
9264ee8 23.75 KiB 913.09 KiB 889.34 KiB
d72784d 23.75 KiB 988.01 KiB 964.27 KiB
8da82b4 23.75 KiB 913.63 KiB 889.88 KiB
43597ba 23.75 KiB 880.32 KiB 856.58 KiB
3cdbc22 23.75 KiB 928.14 KiB 904.40 KiB
bbe6658 23.75 KiB 908.02 KiB 884.27 KiB
00d9740 23.75 KiB 938.32 KiB 914.57 KiB
3067c23 23.75 KiB 928.15 KiB 904.40 KiB
cc7f629 23.75 KiB 878.48 KiB 854.73 KiB
748df9d 23.75 KiB 902.48 KiB 878.74 KiB

@philipphofmann philipphofmann merged commit eaa359e into main Nov 4, 2025
183 of 187 checks passed
@philipphofmann philipphofmann deleted the fix/nsexception-no-reason branch November 4, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clearly point out missing reason for NSExceptions

3 participants