Add support for custom NSException translation function#80
Add support for custom NSException translation function#80sirnacnud wants to merge 1 commit intocross-language-cpp:mainfrom
Conversation
|
This looks solid. Thank you! Let's leave it a moment here to give others also a chance to look at it, and then merge it. If I am too slow, please ping me. (my workload is huge atm) |
|
Do you think it would be possible for you to add a test that sets a handle pointer and checks that this gets called when an exception occurs? |
|
There's nothing wrong with this approach, but the functionality you want is already available using a different technique (or at least should be - see caveats below). In Dropbox's original use of Djinni a custom function was used which threw custom exception classes on both iOS and Android. Note this function declaration:
The Caveats:
I'd suggest you try defining the function |
|
that still exists, djinni-support-lib/djinni/objc/DJIError.h Line 25 in 5beccff and its still the same CMake build |
|
Thanks for the quick responses and explanation of the already existing support. Switching to providing a custom implementation of |
We could possible fix that now, and add it in the docs here , need 'just' find the propper location |
This PR adds support to supply a function to
DJIErrorin order for perform a custom translation of C++ exceptions toNSExceptionoutside the library.The reason to do this is to be able to have a better translated
NSException, as the default translation doesn't use any named constants, just uses the message from the C++ exception for both theNSExceptionname and reason.