[TIMOB-10707] iOS: Expose runtime errors to module developers
GitHub Issue | n/a |
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-09-20T14:28:17.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.0.0, Sprint 2012-19 Core, 2012 Sprint 19 |
Components | iOS |
Labels | core, qe-port |
Reporter | Neeraj Gupta |
Assignee | Max Stepanov |
Created | 2012-08-29T14:23:02.000+0000 |
Updated | 2013-01-11T16:21:58.000+0000 |
Description
Currently module developers have no way to access runtime errors that occur. The errors go directly through the TiJSErrorDialog class and it can not be intercepted to do anything else.
We need to provide a mechanism for module developers to grab the error information and use it for their needs. This can be achieved either through some 'error' event that they can listen to or we could add some hook inside the TiJSErrorDialog class that is called right before we launch the dialog.
1) Titanium is currently trapping all unhandled exceptions. Instead, we need to chain the exception handlers. Module developers have to have the default handler called at some point, so they can get to the exception information.
2) If there is an exception, it might be hard to know which JavaScript method was responsible. One potential solution might be for the to automatically instrument the native, generated code. This can be done by inserting the name of the Javascript method call using Crittercism's breadcrumbs.
Attachments
PR pending https://github.com/appcelerator/titanium_mobile/pull/2881
Test instructions: 1. Add ti.pinkerror module to KS app. 2. Edit app.js to add code below
3. Modify activity_indicator.js to add
4. Run the app, click on Activity Indicator. Expected result: standard UIAlertView with "My Script Error" title.
Pull merged.
Tested with 3.0.0.v20121112163159 on iPhone 4s 6.0.1