Closed andrewmostello closed 4 years ago
That looks great, this will make using Java libraries much more robust. āāā
I'll try this out ASAP, looking forward to it!
Great! Thanks for taking a look!
That is comprehensive exception handling there. Should I add you to the AUTHORS file?
Great - thanks for merging this PR. Sure! It'd be great to be part of the AUTHORS file.
No problem, thanks for the contribution! š I am doing other work ATM but when I get back to doing work with Java and Go this is going to be golden. I already have an app that could benefit from this, it needs to handle network errors from Java.
When I do get back to Java and Go probably will be to creating a wrapper around some of the Android API. This will be generated code. This generated code uses reflection to convert between Go and general generic Java classes, for example like ArrayList<T>
(https://github.com/timob/javabind/blob/master/runtime.go#L343).
Is there anything in particular that you are using JNIGI for?
After working with this package for the last few weeks, I was hoping to improve the way exceptions are handled. I saw that
handleException
had aTODO
line, and wanted to take a crack at fulfilling the need.What I wanted to do here is make sure that any enhanced handling is opt-in, and that it is flexible/customizable. To do that, I created a new ExceptionHandler interface, and added an optional ExceptionHandler field to Env. I think that's the best approach here, especially if it turns out the robust ThrowableErrorExceptionHandler (see below) has problems in production.
Please let me know what you think - thanks!
Details in the commit message: