Skip to content

Conversation

@dwmkerr
Copy link

@dwmkerr dwmkerr commented Jun 21, 2023

I would like to be able to test native exceptions in certain scenarios, but the nativeCrash function calls fatalError for iOS, which is a non-recoverable crash.

This is by design I assume, and Android has nothing exactly equivalent. To support more testing scenarios this adds nativeException that throws an exception in android, and throws NSException for iOS, allowing native exception handlers to be tested.

This does cause some confusion - the behaviour of nativeCrash and nativeException is the same for Android and different for iOS, although that could be argued as a valid difference in the platform, but I'm open to any suggestions to improve this!

I've also updated the docs to be explicit about what each implementation does.

@dwmkerr dwmkerr force-pushed the feat/add-native-exception-function branch from 8434f11 to 952b251 Compare June 21, 2023 23:28
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.

1 participant