@p3c0 Thank you for your help.
The problem is that what I really want in the end is a way to catch errors thrown by C++ functions transparently to the user that writes JavaScript. So, the user can just write a script like:
var X = myCppFunction(foo);
var Y = myOtherCppFunction(bar);
etc.
And when it is executed (myEngine.evaluate) the errors are catched by the C++ code of my application. Something like:
try
{
QJSValue theVal = myEngine.evaluate(the JavaScript script);
if(theVal.isError) {//if there are errors in the JS code enter here}
}
catch( )
{
// If there is an error in the Cpp functions called by the JS code enter here
}
I have seen in this post that this is not currently possible with QJSEngine. In addition, I have seen that a ticket is already open. Therefore, I will have to think something to get around and wait untill the functionality is implemented.
Thank you for your help.