-
Notifications
You must be signed in to change notification settings - Fork 306
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
[experimental-feature] Return custom Rust errors #2369
Comments
Hi! Thanks for opening your first issue here! 😄 |
Here your CustomError should auto Since you are using the experimental feature of auto scanning a whole third party crate, I guess this may be the cause. A workaround may be, could you please try to have your CustomError in your main crate (instead of third party crate), or use the manual way of mirroring the 3rd party crate? |
After I use |
https://cjycode.com/flutter_rust_bridge/guides/third-party/manual/external-types#example Seems that
A workaround may be, create your own enum in first party package (and convert it between the 3rd party one). |
I tried changing the enum to a normal struct and it working. |
Happy to see that! |
Close since this seems to be solved, but feel free to reopen if you have any questions! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue. |
Now there is an Error in a third-party crate, which may be like this.
flutter_rust_bridge.yaml
When returning a
Result<(), CustomError)
, Dart uses print(e.runtimeType); to print outCustomErrorImpl
.I want it to be a CustomError and have access to the type in the enum and call toString().
But dart generates such code, and the Exception type is not CustomError.
The text was updated successfully, but these errors were encountered: