{ "id": "61689", "key": "TIMOB-1057", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2012-07-25T12:43:24.000+0000", "created": "2011-04-15T02:42:45.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "issuelinks": [ { "id": "19395", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "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": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-26T22:25:12.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

a customer has reported that if there is a coding issue (i.e.\r\nmissing var) in an event listener, that error fails to be\r\nregistered in Developer. Following code shows this behavior.

\r\n

var i=0;
\r\ni.missingMethod();

\r\n

appropriately logs the exception but

\r\n

btn.addEventListener('click', function() {
\r\nvar i=0;
\r\ni.missingMethod();
\r\n});

\r\n

does not.

{html}", "attachment": [], "flagged": false, "summary": "iOS: Exceptions failing in event listeners", "creator": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "124712", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This is a threading issue, certainly. We don't catch and report\nexceptions that occur on some threads.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:42:46.000+0000", "updated": "2011-04-15T02:42:46.000+0000" }, { "id": "124713", "author": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I hit this issue so often that I don't call addEventListener()\ndirectly anymore, and instead use:

\n
\nvar listen = function(obj, event, cb) {\n    obj.addEventListener(event, function (e) {\n                             try {\n                                 cb(e);\n                             } catch (err) {\n                                 alert(\"Error in callback: \" + err);\n                             }\n                         });\n};\n
{html}", "updateAuthor": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:42:46.000+0000", "updated": "2011-04-15T02:42:46.000+0000" }, { "id": "124714", "author": { "name": "matthewlieder", "key": "matthewlieder", "displayName": "Matthew Lieder", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

That's a great idea Damien; I'm embarrassed I never even thought\nof doing that. Keep forgetting how flexible Javascript is. Thanks!\nThat'll be a great duct-tape bandage until they fix this.

{html}", "updateAuthor": { "name": "matthewlieder", "key": "matthewlieder", "displayName": "Matthew Lieder", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:42:46.000+0000", "updated": "2011-04-15T02:42:46.000+0000" }, { "id": "176440", "author": { "name": "programmerdave", "key": "programmerdave", "displayName": "David Rodriguez", "active": true, "timeZone": "America/New_York" }, "body": "Is there any way to do a stack trace with a try and catch?", "updateAuthor": { "name": "programmerdave", "key": "programmerdave", "displayName": "David Rodriguez", "active": true, "timeZone": "America/New_York" }, "created": "2011-12-18T21:35:03.000+0000", "updated": "2011-12-18T21:35:03.000+0000" }, { "id": "209369", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce described issue in SDK 2.2.0.f9e938d with iPhone Sim 5.1.\r\n\r\n{code}\r\nvar i=0;\r\ni.missingMethod();\r\n\r\nappropriately logs the exception but\r\n\r\nbtn.addEventListener('click', function() {\r\nvar i=0;\r\ni.missingMethod();\r\n});\r\n{code}\r\n\r\nThis logs information in the console indicating an exception has occurred.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-25T12:43:24.000+0000", "updated": "2012-07-25T12:43:24.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }