{ "id": "161671", "key": "TIMOB-23621", "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": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-08-30T05:22:14.000+0000", "created": "2016-07-11T17:09:29.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "qe-5.4.0" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-12-08T00:26: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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nWhen calling a function that has a minimum required number of args, in the example provided I use the appendRow method with only 1 argument, the error below is printed out\r\n\r\n{code}\r\n[ERROR] : Application Error: {\r\n[ERROR] : \"line\": 2,\r\n[ERROR] : \"column\": 10,\r\n[ERROR] : \"message\": \"Error while require(/app) invalid vector subscript\",\r\n[ERROR] : \"native_stack\": [\r\n[ERROR] : \"JSExportClass::CallNamedFunction\"\r\n[ERROR] : ]\r\n[ERROR] : }\r\n{code}\r\n\r\nHowever when building for Android the following error is thrown, which explains the reason for the error\r\n\r\n{code}\r\n[ERROR] : TiExceptionHandler: (main) [70,70] ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : TiExceptionHandler: (main) [0,70] - In app.js:7,7\r\n[ERROR] : TiExceptionHandler: (main) [0,70] - Message: Uncaught Error: insertRowAfter: Invalid number of arguments. Expected 2 but got 1\r\n[ERROR] : TiExceptionHandler: (main) [1,71] - Source: table.insertRowAfter(Ti.UI.createTableViewRow({ title: 'notEnoughArgs' }));\r\n[ERROR] : V8Exception: Exception occurred at app.js:7: Uncaught Error: insertRowAfter: Invalid number of arguments. Expected 2 but got 1\r\n{code}\r\n\r\nDemo code\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nTi.UI.createTableViewRow({ title: 'Bananas' });\r\nvar table = Ti.UI.createTableView({});\r\ntable.insertRowAfter(Ti.UI.createTableViewRow({ title: 'notEnoughArgs' }));\r\nwin.add(table);\r\nwin.open();\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n1. Using the code above build for Windows Platform using {{appc run -p windows -T wp-emulator}}\r\n\r\nh5.Actual result\r\n\r\nThe first error will be shown, which gives the user no help in diagnosing the issue\r\n\r\nh5.Expected result\r\n\r\nAn error similar to the Android error should be shown, informing the user why the error was thrown", "attachment": [], "flagged": false, "summary": "Windows: Improve error message when passing an invalid number of arguments to a function ", "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": "Windows 10 Pro\r\nTi SDK: 5.4.0.v20160705213725\r\nAppc NPM: 4.2.8-1 \r\nAppc CLI: 5.4.0-29", "closedSprints": [ { "id": 704, "state": "closed", "name": "2016 Sprint 18 SDK", "startDate": "2016-08-27T00:18:36.960Z", "endDate": "2016-09-10T00:18:00.000Z", "completeDate": "2016-09-09T20:26:13.865Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "393771", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/831", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-08-22T12:58:34.000+0000", "updated": "2016-08-22T12:58:34.000+0000" }, { "id": "402935", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified improvement, message is more clear to indicate what the error is ; error message shown below. \r\n{code:java}\r\n[ERROR] : ----- Titanium Javascript Runtime Error -----\r\n[ERROR] : In app.js: 4,21\r\n[ERROR] : Message: Uncaught Error: insertRowAfter: Invalid number of arguments. Expected 2 but got 1\r\n{code}\r\n*Environment*\r\n{code:java}\r\nOperating System\r\n Name = Microsoft Windows 10 Pro\r\n Version = 10.0.14393\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 17034395648\r\n \r\nNode.js\r\n Node.js Version = 4.4.4\r\n npm Version = 2.11.3\r\n \r\nTitanium CLI\r\n CLI Version = 5.0.10\r\n \r\nTitanium SDK\r\n SDK Version = 6.1.0.v20161207121046\r\n{code}\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-08T00:24:07.000+0000", "updated": "2016-12-08T00:24:07.000+0000" }, { "id": "402936", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Further environment information. \r\n{code:java}\r\nWindows Emulator: Mobile Emulator 10.0.14393.0 1080p 6 inch 2GB \r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-08T00:26:45.000+0000", "updated": "2016-12-08T00:26:45.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }