Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10707] iOS: Expose runtime errors to module developers

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-20T14:28:17.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.0.0, Sprint 2012-19 Core, 2012 Sprint 19
ComponentsiOS
Labelscore, qe-port
ReporterNeeraj Gupta
AssigneeMax Stepanov
Created2012-08-29T14:23:02.000+0000
Updated2013-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

FileDateSize
ti.pinkerror-iphone-0.1.zip2012-09-10T15:14:12.000+000022284

Comments

  1. Max Stepanov 2012-09-06

    PR pending https://github.com/appcelerator/titanium_mobile/pull/2881
  2. Max Stepanov 2012-09-10

    Test instructions: 1. Add ti.pinkerror module to KS app. 2. Edit app.js to add code below
       var pinkerror = require('ti.pinkerror');
       Ti.API.info("module is => "+pinkerror);
       
    3. Modify activity_indicator.js to add
       var a = new Array(0x100000000);
       
    4. Run the app, click on Activity Indicator. Expected result: standard UIAlertView with "My Script Error" title.
  3. Blain Hamon 2012-09-20

    Pull merged.
  4. Natalie Huynh 2012-11-13

    Tested with 3.0.0.v20121112163159 on iPhone 4s 6.0.1

JSON Source