{ "id": "104324", "key": "TIMOB-11653", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15093", "description": "2013 Sprint 03 Core", "name": "2013 Sprint 03 Core", "archived": true, "released": true, "releaseDate": "2013-02-11" }, { "id": "14813", "description": "2013 Sprint 03", "name": "2013 Sprint 03", "archived": true, "released": true, "releaseDate": "2013-02-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-01-29T01:23:40.000+0000", "created": "2012-11-02T17:33:15.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "22488", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "104321", "key": "TIMOB-11652", "fields": { "summary": "iOS: Add script errors/stack trace to TiExceptionHandler data", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "38803", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "132549", "key": "TIMOB-17268", "fields": { "summary": "TiAPI: Make call stack available through Error.prototype.stack property", "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": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T21:43:35.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": "JavaScript:\r\n{code}\r\n// Without try catch:\r\nvar err = new Error(\"My Awesome Caught Error!\");\r\nAPI.logHandledException(err);\r\n\r\ntry {\r\nvar err = new Error(\"My Awesome Caught Error!\");\r\nthrow err\r\n\r\n} catch (err){\r\nAPI.logHandledException(err);\r\n}\r\n{code}\r\n\r\nObjective-C:\r\n{code}\r\n-(void)logHandledException:(id)args\r\n{\r\n TiLogMessage([NSString stringWithFormat:@\"class type?: %@\", [[args objectAtIndex:0] class]]); // This returns as NSDictionary, is this expected?\r\n\r\n// TiScriptError *exception = [TiScriptError initWithDictionary:[args objectAtIndex:0]]; // This selector doesn't exist?\r\n TiScriptError *exception = (TiScriptError *)args; // Returns an array, not a single object. In other methods, they returned the objects rather than an array of parameters.\r\n\r\n[API logHandledException:[self convertScriptErrorToNative:exception]];\r\n}\r\n{code}\r\n\r\nTesting steps: \r\n1. Download CritterModule, and build it with a Titanium Mobile project.\r\n2. Run this code (app.js):\r\n{code}\r\nvar CritterModule = require('com.crittermodule');\r\n\r\nvar win = Ti.UI.createWindow({fullscreen: true, backgroundColor: 'white'});\r\n\r\nvar stackLabel = Ti.UI.createLabel({\r\n\tleft: \"10%\",\r\n\ttop: \"20%\",\r\n\tcolor: 'red'\r\n\t\r\n});\r\nvar lineNumberLabel = Ti.UI.createLabel({\r\n\tleft: \"10%\",\r\n\ttop: \"50%\",\r\n\tcolor: 'red'\r\n\t\r\n});\r\nvar messageLabel = Ti.UI.createLabel({\r\n\tleft: \"10%\",\r\n\ttop: \"70%\",\r\n\tcolor: 'red'\r\n\t\r\n});\r\nvar fileNameLabel = Ti.UI.createLabel({\r\n\tleft: \"10%\",\r\n\ttop: \"85%\",\r\n\tcolor: 'red'\r\n\t\r\n});\r\n\r\nvar errorButton = Ti.UI.createButton({\r\n\ttop: 0,\r\n\ttitle: \"Throw error\"\r\n});\r\n\r\nvar err = new Error(\"uh oh!\");\r\nerrorButton.addEventListener(\"click\", function(e){\r\n\ttry {\r\n\t\tthrow err;\r\n\t} catch(e) {\r\n\t\tstackLabel.text = CritterModule.printErrorStack(e);\r\n\t\tlineNumberLabel.text = \"Line number: \" + CritterModule.printErrorLineNumber(e);\r\n\t\tmessageLabel.text = \"Error Message: \" + CritterModule.printErrorMessage(e);\r\n\t\tfileNameLabel.text = \"File name: \" + CritterModule.printErrorFileName(e);\r\n}\r\n\r\n});\r\n\r\n\r\n\r\n\r\nwin.add(stackLabel);\r\nwin.add(lineNumberLabel);\r\nwin.add(messageLabel);\r\nwin.add(fileNameLabel);\r\nwin.add(errorButton);\r\nwin.open();\r\n{code}\r\n\r\n3. Click on \"Throw error\" button. You should see the stack trace, line number, error message and file name.", "attachment": [ { "id": "34766", "filename": "com.crittermodule.zip", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-15T16:52:21.000+0000", "size": 49846, "mimeType": "application/zip" }, { "id": "34719", "filename": "CritterModule.zip", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-14T13:39:14.000+0000", "size": 63063, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: Add script errors/stack trace to TiExceptionHandler data", "creator": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [ { "id": "108691", "key": "TIMOB-12463", "fields": { "summary": "Backport to 3_0_X: TIMOB-11653", "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": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } ], "reporter": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "225998", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In Android, we already have an API to do this:\r\n\r\nKrollRuntime.dispatchException()", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-02T18:02:55.000+0000", "updated": "2012-11-02T18:02:55.000+0000" }, { "id": "228887", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This evidently still needs to be done.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-28T20:41:52.000+0000", "updated": "2012-11-28T20:41:52.000+0000" }, { "id": "233689", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/3685", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-09T10:54:10.000+0000", "updated": "2013-01-09T10:54:10.000+0000" }, { "id": "413167", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue has been fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T21:43:35.000+0000", "updated": "2017-03-16T21:43:35.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }