-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential approach to support external errors #2265
base: main
Are you sure you want to change the base?
Conversation
I'm mildly surprised we don't support this, but it looks like we do not! A very quick look implies this seems sane for Swift as it's what we did for other uses for external types - however, we'd obviously want tests here. I'd suggest maybe reusing the ext-types fixture - eg, there's a |
I wrote up a test case for the proc-macro which works as expected. Unfortunately I ran into a few issues with udl. With the latest commit I get the following error message:
My suspicion from debugging the expanded udl file is that it's missing a I also experimented slightly with Kotlin which in some ways seems to also be quite straightforward as we should only need to add an import to the Exception. Unfortunately my initial attempt of adding a Curious if you have any quick thoughts on a better approach. |
Yeah - I suspect you need
The templating system is tricky, but that should work if you move the call out of macros.kt A quick look though shows you seem to be on the right track! |
This is a bit of a stab in the dark attempt at supporting external errors in uniffi.
It currently seems to behave well for swift but before I continue diving into the uniffi internals I would appreciate some guidance if this is the appropriate way to address this as the internals of uniffi is a large mystery to me.
Remaining tasks: