{ "id": "169622", "key": "TIMOB-25189", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2021-02-11T12:14:57.000+0000", "created": "2017-08-23T09:40:55.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "issuelinks": [], "assignee": null, "updated": "2021-02-11T12:14:57.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nWhen calling apply with a style, where the TargetType in the XAML style doesn't match the correct underlying control used by Titanium the error message is currently the below, it would be nice if we could catch the error correctly and then report this back to the user\r\n\r\n{code}\r\n[ERROR] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] In app.js: 6,12\r\n[ERROR] Message: Uncaught Error: apply: unknown exception\r\n{code}\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({ backgroundColor: 'white' });\r\nvar lbl = Ti.UI.createLabel({\r\n text: 'label'\r\n})\r\nvar style = Ti.UI.Windows.createStyle({ source: 'ms-appx:///Styles.xaml' });\r\nstyle.apply(lbl, 'LabelStyle');\r\nwin.open();\r\n{code}\r\n\r\n{code}\r\n\r\n \r\n\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n# Copy the above app.js and styles.xaml into your project\r\n# Build for a Windows target\r\n\r\nh5.Actual\r\n\r\n{{Unknown exception}} error is thrown\r\n\r\nh5.Expected\r\n\r\nA nicer error that maybe just spits back the error returned from nativeland? {{WinRT information: Cannot apply a Style with TargetType 'Windows.UI.Xaml.Controls.TextBox' to an object of type 'Windows.UI.Xaml.Controls.TextBlock'.}}", "attachment": [], "flagged": false, "summary": "Windows: Throw better error when calling style.apply with an incorrect TargetType", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "SDK: tbd\r\nWindows 10 Pro 10.0.15063", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }