-
Notifications
You must be signed in to change notification settings - Fork 67
☂️ Exceptions #561
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
Comments
* Handle multi anonymous struct with same USR (dart-lang#559) Co-authored-by: Daco Harkes <[email protected]>
Hi! This is in the context of the upcoming ok_http package using jnigen for the Kotlin package OkHttp. Specifically this PR This is the problem we faced:
Workaround:
(Just in case someone faces the same problem and looks for how others dealt with it) Would there have been a better way to resolve this? TL;DR - Faced problems with throwing exceptions within interface implementations using |
The problem is all thrown exceptions are currently wrapped in a You can fix this if you have time: #1209. I added some code pointers there. |
What if someone wants to write some custom Java interface that is aware of the fact that it's going to be used in Dart. Maybe in this case the developer would want to catch Dart exceptions which we currently don't allow. I personally don't think this is of the highest priority. (Discussion dart-archive/jnigen#376 (comment))
- [ ] Support handlingDartException
s in custom codeEdit: We'll not support the above, it's encouraged to throw existing Java exceptions from Dart which is now supported.
Another thing that users might want to do is throw actual Java exceptions. This seems to be useful actually, and we could use the same Dart
throw
keyword to achieve this by checking if the exception thrown is of typeJException
.However currently
JException
doesn't inheritJObject
, we can change this by adding theThrowable
andException
types as core types topackage:jni
.JException
inheritJObject
and include it inpackage:jni
#567The text was updated successfully, but these errors were encountered: