Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25523] Hyperloop: Android - Add support to catch typed exceptions

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sHyperloop 3.0.0
Fix Version/sn/a
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterJan Vennemann
AssigneeJan Vennemann
Created2017-11-16T15:24:24.000+0000
Updated2018-03-28T18:48:05.000+0000

Description

With 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

Comments

No comments

JSON Source