Project: titanium
Issue TIMOB-23621: Windows: Improve error message when passing an invalid number of arguments to a function 
h5.Description When 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 {code} [ERROR] : Application Error: { [ERROR] : "line": 2, [ERROR] : "column": 10, [ERROR] : "message": "Error while require(/app) invalid vector subscript", [ERROR] : "native_stack": [ [ERROR] : "JSExportClass::CallNamedFunction" [ERROR] : ] [ERROR] : } {code} However when building for Android the following error is thrown, which explains the reason for the error {code} [ERROR] : TiExceptionHandler: (main) [70,70] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,70] - In app.js:7,7 [ERROR] : TiExceptionHandler: (main) [0,70] - Message: Uncaught Error: insertRowAfter: Invalid number of arguments. Expected 2 but got 1 [ERROR] : TiExceptionHandler: (main) [1,71] - Source: table.insertRowAfter(Ti.UI.createTableViewRow({ title: 'notEnoughArgs' })); [ERROR] : V8Exception: Exception occurred at app.js:7: Uncaught Error: insertRowAfter: Invalid number of arguments. Expected 2 but got 1 {code} Demo code {code} var win = Ti.UI.createWindow(); Ti.UI.createTableViewRow({ title: 'Bananas' }); var table = Ti.UI.createTableView({}); table.insertRowAfter(Ti.UI.createTableViewRow({ title: 'notEnoughArgs' })); win.add(table); win.open(); {code} h5.Steps to reproduce 1. Using the code above build for Windows Platform using {{appc run -p windows -T wp-emulator}} h5.Actual result The first error will be shown, which gives the user no help in diagnosing the issue h5.Expected result An error similar to the Android error should be shown, informing the user why the error was thrown
Story points: 5