rickclephas / NSExceptionKt

A Kotlin Multiplatform Library to improve crash reports on Apple platforms
MIT License
181 stars 12 forks source link

FIRCLSExceptionRecordNSException v.s. raise it #20

Closed b95505017 closed 11 months ago

b95505017 commented 11 months ago

It seems like FIRCLSExceptionRecordNSException is not a public api? Wondering why not just raise the NSException.

rickclephas commented 11 months ago

Yeah, correct, it isn't part of the public API. The main reason why we don't raise exceptions is that we don't want to interrupt the existing flow. If we were to raise an exception, any existing unhandeled exception hooks wouldn't be called anymore.

b95505017 commented 11 months ago

Does FIRCLSExceptionRecordNSException be called explicitly when an exception triggered/raised in a pure iOS project without KMP? I want to follow the same flow.

rickclephas commented 11 months ago

Yes Crashlytics uses FIRCLSExceptionRecordNSException internally as well, as can be seen in the source code.