getsentry/sentry-cocoa

Make SentryException value and type nullable

Opened this issue · 0 comments

Description

Only one of SentryException.value or SentryException.type is required to be nonnull; see Relay. The value can already be nil when converting an NSException to a SentryException in the client as NSException.reason is nullable.

SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelError];
SentryException *sentryException = [[SentryException alloc] initWithValue:exception.reason
type:exception.name];

Therefore, we should make both value and type nullable readonly and add constructors to ensure either one of the two is set. Consider converting this class to Swift when doing these changes.