TIMOB-24657 we allowed exceptions to bubble up to JS so they can be utilized in try-catch-blocks. All exception will be converted to strings though, so there cannot be done any type checking against the exception class, which is crucial in Java. The following approach solves this issue:
- Throw a special HyperloopException from Java based on a catched InvocationTargetException.
- Handle those exception in https://github.com/appcelerator/titanium_mobile/blob/master/android/runtime/v8/src/native/JSException.cpp#L37. Get the original exception via getCause() and construct a HyperloopNativeExceptionError in JS which allows the developer to access the underlying native Exception