{ "id": "99474", "key": "TIMOB-10505", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14161", "description": "Release 3.0.1", "name": "Release 3.0.1", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14097", "description": "Sprint 2012-18 Core", "name": "Sprint 2012-18 Core", "archived": true, "released": true, "releaseDate": "2012-09-10" }, { "id": "14275", "description": "2012 Sprint 18", "name": "2012 Sprint 18", "archived": true, "released": true, "releaseDate": "2012-09-10" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-01-29T17:41:25.000+0000", "created": "2012-08-20T18:12:08.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "core" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "20419", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "100140", "key": "TIMOB-10707", "fields": { "summary": "iOS: Expose runtime errors to module developers", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "25896", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "90893", "key": "TIMOB-8890", "fields": { "summary": "Android: Unable to catch any errors while creating a crash reporter", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "24465", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "107759", "key": "TIMOB-12274", "fields": { "summary": "Runtime errors: Codify and implement a consistent interface for thrown errors across platforms", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-02-16T00:38:47.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "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.\r\n\r\nWe 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.\r\n\r\n1) 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.\r\n \r\n2) 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.", "attachment": [ { "id": "31153", "filename": "app.js", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T16:12:29.000+0000", "size": 980, "mimeType": "text/javascript" }, { "id": "31154", "filename": "com.exceptionhandler-android-0.1.zip", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T16:12:29.000+0000", "size": 49798, "mimeType": "application/zip" }, { "id": "31155", "filename": "ExceptionhandlerModule.java", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T16:31:29.000+0000", "size": 3012, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: Expose runtime errors to module developers", "creator": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "217885", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Ready: https://github.com/appcelerator/titanium_mobile/pull/2879\r\n\r\nFor testing, put some bad code in app.js like:\r\n{code}\r\nwin.open();\r\n{code}\r\n\r\nVerify that the error dialog pops up as usual. This should be tested in BOTH V8 and Rhino.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-06T15:23:52.000+0000", "updated": "2012-09-06T15:23:52.000+0000" }, { "id": "217888", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For module developers, there is a KrollExceptionHandler interface that they can implement to deal with exceptions. Then the handler can be hooked up to the runtime by simple calling the static method:\r\n\r\nKrollRuntime.setExecptionHandler(KrollExceptionHandler handler);\r\n\r\nModules can also subclass the TiExceptionHandler class to perform some logic before doing the default behavior.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-06T15:28:22.000+0000", "updated": "2012-09-06T15:28:22.000+0000" }, { "id": "218284", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated Test Case:\r\n\r\n1. Install the attached module into your project\r\n2. Use the app.js provided and run the app.\r\n3. Run 'adb logcat -s ExceptionhandlerModule' on the command line\r\n4. Click 'Add Exception Handler' twice\r\n5. Click 'Remove Exception Handler' once\r\n6. Click 'Trigger Error' once\r\n\r\nWhen you click 'Trigger Error', you should see something like: \r\n\r\n{code}\r\nD/ExceptionhandlerModule(20757): (KrollRuntimeThread) [5998,257272] ---------------- Additional listener fired1\r\n{code}\r\n\r\nAfter that, hit Continue on the error dialog and:\r\n7. Click 'Remove Exception Handler' once\r\n8. Click 'Overwrite Primary handler'\r\n9. Click 'Trigger Error'\r\n\r\nYou should see:\r\n{code}\r\nI/ExceptionhandlerModule(20757): (KrollRuntimeThread) [5964,361847] ---------------- New primary exception handler fired\r\n{code}\r\n\r\nPlease test this on both V8 and Rhino.\r\n\r\nAfterwards, feel free to try any other combination.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T16:28:55.000+0000", "updated": "2012-11-14T04:50:25.000+0000" }, { "id": "218288", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FYI, I've also attached the ExceptionhandlerModule.java file in case anyone wants to see how I called the new APIs introduced.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T16:32:27.000+0000", "updated": "2012-09-10T16:32:27.000+0000" }, { "id": "227152", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 3.0.0.v20121112163159 on Android \r\nGet D/ExceptionhandlerModule( 452): (KrollRuntimeThread) [1322,51567] ---------------- Additional listener fired1\r\nRuntime error: view.methodDoesNotExist();\r\nDo not see --------New primary exception handler fired", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-13T18:16:28.000+0000", "updated": "2012-11-13T18:16:28.000+0000" }, { "id": "227281", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I just tested it and did not see the primary exception handler fired either (it shouldn't since we never overwrote it). I've updated the test case to reflect this.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-14T04:54:07.000+0000", "updated": "2012-11-14T04:54:07.000+0000" }, { "id": "232304", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Needs retest, please.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-21T05:23:31.000+0000", "updated": "2012-12-21T05:23:31.000+0000" }, { "id": "236167", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "\"Additional listener fired1\" didn't occur on logcat\r\nwhile \"New primary exception handler fired\" occurred on logcat.\r\n\r\nTested on :\r\nandroid version: 2.3.6\r\nSDK version: 3.0.0.GA ,3.0.2.v20130126230207\r\nCLI version : 3.0.23\r\nOS : MAC OSX 10.7.5\r\nXCode : 4.5.1", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-01-28T12:15:53.000+0000", "updated": "2013-01-28T12:15:53.000+0000" }, { "id": "236369", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just ran this against 3_0_X and got the following:\n\n{code}\nD/ExceptionhandlerModule( 6932): (KrollRuntimeThread) [25868,56830] ---------------- Added exception handler1\nD/ExceptionhandlerModule( 6932): (KrollRuntimeThread) [1074,57904] ---------------- Added exception handler2\nD/ExceptionhandlerModule( 6932): (KrollRuntimeThread) [6164,64068] ---------------- Removed exception handler2\nD/ExceptionhandlerModule( 6932): (KrollRuntimeThread) [2691,66759] ---------------- Additional listener fired1\nD/ExceptionhandlerModule( 6932): (KrollRuntimeThread) [29507,96269] ---------------- Removed exception handler1\nI/ExceptionhandlerModule( 6932): (KrollRuntimeThread) [12004,108273] ---------------- New primary exception handler fired\n{code}\n\n\"Additional listener fired1\" does occur for me.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-29T02:19:28.000+0000", "updated": "2013-01-29T02:19:28.000+0000" }, { "id": "237990", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the issue by running the attached app.js & module & saw the expected output.\r\n{code}\r\nD/ExceptionhandlerModule( 3041): (KrollRuntimeThread) [16121,46570] ---------------- Added exception handler1\r\nD/ExceptionhandlerModule( 3041): (KrollRuntimeThread) [11801,58371] ---------------- Added exception handler2\r\nD/ExceptionhandlerModule( 3041): (KrollRuntimeThread) [8914,74118] ---------------- Additional listener fired1\r\nD/ExceptionhandlerModule( 3041): (KrollRuntimeThread) [14554,119141] ---------------- Removed exception handler1\r\nI/ExceptionhandlerModule( 3041): (KrollRuntimeThread) [10311,129452] ---------------- New primary exception handler fired\r\n{code}\r\n\r\nThus closing the issue.\r\n\r\nEnvironment:\r\nTi Studio : 3.0.2.201302041757\r\nTi BB SDK : 3.0.2.v20130207164659\r\nMac OSX : 10.8.2\r\nCLI Version : 3.0.24-cr", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-11T18:03:11.000+0000", "updated": "2013-02-11T18:03:11.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }