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
[ERROR] : Application Error: {
[ERROR] : "line": 2,
[ERROR] : "column": 10,
[ERROR] : "message": "Error while require(/app) invalid vector<T> subscript",
[ERROR] : "native_stack": [
[ERROR] : "JSExportClass<class Titanium::GlobalObject>::CallNamedFunction"
[ERROR] : ]
[ERROR] : }
However when building for Android the following error is thrown, which explains the reason for the error
[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
Demo 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();
Steps to reproduce
1. Using the code above build for Windows Platform using
appc run -p windows -T wp-emulator
Actual result
The first error will be shown, which gives the user no help in diagnosing the issue
Expected result
An error similar to the Android error should be shown, informing the user why the error was thrown
https://github.com/appcelerator/titanium_mobile_windows/pull/831
Verified improvement, message is more clear to indicate what the error is ; error message shown below.
*Environment*Operating System Name = Microsoft Windows 10 Pro Version = 10.0.14393 Architecture = 64bit # CPUs = 4 Memory = 17034395648 Node.js Node.js Version = 4.4.4 npm Version = 2.11.3 Titanium CLI CLI Version = 5.0.10 Titanium SDK SDK Version = 6.1.0.v20161207121046Further environment information.