{ "id": "172184", "key": "TIMOB-26369", "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": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-09-22T15:05:24.000+0000", "created": "2018-09-06T10:25:41.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2019-05-01T20:25:45.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": "When stack traces where added to the display of unhandled exceptions in May 2018, the functionality was removed. I can provide a PR to fix that.\r\nFiles that need to be modified:\r\nAppModule.m , line 368\r\n{code:java}\r\n[nc addObserver:self selector:@selector(errored:) name:kTiErrorNotification object:nil];\r\n{code}\r\n\r\nTiExceptionHandler.m , line 58\r\n{code:java}\r\n- (void)showScriptError:(TiScriptError *)error\r\n{\r\n NSArray *exceptionStackTrace = [NSThread callStackSymbols];\r\n\r\n if (exceptionStackTrace == nil) {\r\n [[TiApp app] showModalError:[error description]];\r\n [[NSNotificationCenter defaultCenter] postNotificationName:kTiErrorNotification\r\n object:self\r\n userInfo:error.dictionaryValue];\r\n } else {\r\n NSMutableArray *formattedStackTrace = [[[NSMutableArray alloc] init] autorelease];\r\n NSUInteger exceptionStackTraceLength = [exceptionStackTrace count];\r\n\r\n // re-size stack trace and format results. Starting at index = 4 to not include the script-error API's\r\n for (NSInteger i = 4; i < (exceptionStackTraceLength >= 20 ? 20 : exceptionStackTraceLength); i++) {\r\n NSString *line = [[exceptionStackTrace objectAtIndex:i] stringByReplacingOccurrencesOfString:@\" \" withString:@\"\"];\r\n [formattedStackTrace addObject:line];\r\n }\r\n\r\n NSString *stackTrace = [formattedStackTrace componentsJoinedByString:@\"\\n\"];\r\n [[TiApp app] showModalError:[NSString stringWithFormat:@\"%@\\n\\n%@\", [error description], stackTrace]];\r\n NSMutableDictionary *errorDict = [error.dictionaryValue mutableCopy];\r\n [errorDict setObject:stackTrace forKey:@\"stackTrace\"];\r\n [[NSNotificationCenter defaultCenter] postNotificationName:kTiErrorNotification\r\n object:self\r\n userInfo:errorDict];\r\n }\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: unhandledException Ti.App event no longer working.", "creator": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "441409", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, please assign the PR to this ticket. Moving it to engineering. Thanks", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-09-07T12:59:51.000+0000", "updated": "2018-09-07T12:59:51.000+0000" }, { "id": "441412", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "Done :) ", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-07T13:57:49.000+0000", "updated": "2018-09-07T13:57:49.000+0000" }, { "id": "442692", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Verified fix in SDK Version {{7.5.0.v20181016071050}}\r\n\r\nTested using the following test case:\r\n{code:java}\r\nTi.App.addEventListener('uncaughtException', function(evt) {\r\n alert({\r\n // Both iOS and Android:\r\n message: evt.message,\r\n line: evt.line,\r\n\r\n // iOS Only:\r\n sourceId: evt.sourceId,\r\n type: evt.type,\r\n sourceURL: evt.sourceURL,\r\n backtrace: String(evt.backtrace).substr(0, 100) + '...',\r\n\r\n // Android Only:\r\n title: evt.title,\r\n sourceName: evt.sourceName,\r\n lineSource: evt.lineSource,\r\n lineOffset: evt.lineOffset\r\n });\r\n});\r\n\r\nthrow new Error('Hello, error handler!');{code}\r\n\r\nAble to see:\r\n{code:java}\r\n[DEBUG] : Firing app event: uncaughtException\r\n{code}\r\nThis was not visible before this fix.\r\n\r\n*Test Environment*\r\n{code:java}\r\nAPPC Studio: 5.1.0.201808080937\r\niPhone 6 Sim (iOS 12)\r\nAPPC CLI: 7.0.6\r\nOperating System Name: Mac OS Mojave\r\nOperating System Version: 10.14\r\nNode.js Version: 8.9.1\r\nXcode 10.0{code}\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-17T13:09:21.000+0000", "updated": "2018-10-17T13:09:21.000+0000" }, { "id": "448127", "author": { "name": "amigoni", "key": "amigoni", "displayName": "Leonardo Amigoni", "active": true, "timeZone": "Europe/Berlin" }, "body": "I'm still seeing this issue in 8.0. It was firing for a while but not it doesn't seem to. Unfortunately I can't seem to reproduce the case where it was firing. Android works fine iOS doesn't", "updateAuthor": { "name": "amigoni", "key": "amigoni", "displayName": "Leonardo Amigoni", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-05-01T20:25:45.000+0000", "updated": "2019-05-01T20:25:45.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }