{ "id": "77602", "key": "AC-3053", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2011-07-09T04:55:17.000+0000", "created": "2011-07-08T01:27:53.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "tguntharp", "key": "tguntharp", "displayName": "Tony Guntharp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:48:05.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Hi.\r\n\r\n\"Ti.include\" throws uncatchable exception when trying to include file that don't exists.\r\n\r\nFollowing code demonstrates the issue:\r\n\r\n{code:javascript}\r\ntry {\r\n Ti.include('/file/that/dont/exist.js');\r\n}\r\ncatch(e) {\r\n Ti.API.error(e.message);\r\n}\r\n{code} \r\n\r\nThis code throws \"java.io.FileNotFoundException\" that can't be caught.\r\n\r\nQ/A: http://developer.appcelerator.com/question/121769/catch-tiinclude-file-not-found-exception", "attachment": [], "flagged": false, "summary": "\"Ti.include\" throws uncatchable exception when file don't exist", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Titanium mobile SDK 1.7.1 (06/21/11 14:28 1293a6d), Windows XP, Android 2.2 (Samsung Galaxy Tab)", "comment": { "comments": [ { "id": "159110", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Ivan, what you are asking does not make sense at all. You should not ship an app that has missing files. Hence, an exception is the best way of preventing this.\n\nPlease let me know if I have overlooked a reasonable situation where it should indeed be done.\n\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-07-09T04:55:17.000+0000", "updated": "2011-07-09T04:55:17.000+0000" }, { "id": "159111", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "btw, including the SDK build date and hash is required when submitting tickets. Please refer to [Jira Ticket Checklist|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist].\r\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-07-09T04:56:19.000+0000", "updated": "2011-07-09T04:56:19.000+0000" }, { "id": "159157", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hi Paul.\r\n\r\nI've updated ticket with SDK build date and hash.\r\n\r\n\r\nAs for your comment, I agree with you. But, in dynamic scenarios (and with respect on variety of mobile and tablet application purposes and implementations) you can't predict and test any possible situation and exceptions are possible (including exceptions generated by \"Ti.include\"). What I would like to have is ability to control situations when exception is thrown (log errors for example, recover from exception, etc.).\r\n\r\nThis particular exception can be avoided using \"file.exists()\", but IMHO, using try-catch block is semantically correct approach.\r\n\r\nYou can leave this as it is now, but then at least update documentation with explanation that \"Ti.include\" throws uncatchable exception if file is not found.\r\n\r\nThanks.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2011-07-11T03:18:23.000+0000", "updated": "2011-07-11T03:18:23.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }