-
Notifications
You must be signed in to change notification settings - Fork 234
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
External Error
support
#1605
Comments
Error
being replaced with Exception
in kotlin generation breaks externalsError
being replaced with Exception
in kotlin generation breaks externals
ExternalTypes are proving problematic in some cases, because we don't know what they are. A solution to this specific problem is probably to add a new variant here so that the bindings generator knows the type is an error. Longer term I wonder if leaning into "library mode" is the way to go so that we can learn about the actual type of all "external" types. |
Error
being replaced with Exception
in kotlin generation breaks externalsError
support
I think #1600 maybe addresses part of the issue here, but after that I see this error:
Once that's merged I can take a look and try to fix this one. I don't think it's too hard. Did we ever support external errors? I don't see any code in |
I don't think so, but more by omission than intent. |
I'm now running into this, too. What would need to be done to address this? |
I doubt this will be a trivial change. Off the top of my head, I suspect |
Thanks, that does sound rather involved, yeah. It seems to be a common thing when using a multi-crate workspace. Is there a way to avoid this issue besides moving everything into a single crate (which, at least for us, would be a legitimate last resort option)? |
I'm afraid I can't think of another work around. While I said the change might not be trivial, I also don't think it would be particularly complicated, and I'd be happy to help with guidance. |
I have a common error that I want to return from a few APIs called
ApiError
. I have defined this in myerror
crate:When I include this error as an external in another crate, the generated kotlin code tries to import
ApiError
, but when the kotlin class is created it has been renamed toApiException
so my kotlin package doesnt compile.It looks like this is intended behaviour that was introduced in 0.13.0
The docs mention that errors should work as externals here so I'm not really sure what is the best way to deal with this.
For now i'm working around this by just naming my enum
ApiErr
┆Issue is synchronized with this Jira Task
┆Issue Number: UNIFFI-286
The text was updated successfully, but these errors were encountered: