[TIMOB-10530] Android: Java exceptions should be converted and thrown as JS exceptions.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-08-21T15:06:50.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | core |
Reporter | Josh Roesslein |
Assignee | Josh Roesslein |
Created | 2012-08-21T14:40:20.000+0000 |
Updated | 2014-06-19T12:44:39.000+0000 |
Description
When making a JS call that binds to a Java method and an exception is thrown
we should catch it in Kroll and convert it into a JS exception.
This can allow developers to handle them more gracefully and also
pinpoints where in the JS code the crash originated. Having both a JS and Java
trace would be valuable in debugging platform bugs reported by our developers.
This also allows us to throw exception due to invalid calls.
For example if the developer calls View.add() passing a non-view we
can throw an exception. This provides a trace to the point of the error
so the developer does not need to hunt for the bad JS call site.
Parity should also be considered on how we handle invalid method calls due to developer errors. Any intentional exceptions thrown should be consistent across all platforms. Exception specific to Android internals (ex: null pointer) can be an exception.
My bad this actually working fine for sync based calls. The case I was seeing was due to the exception getting thrown async on the UI thread. :\