Forum Discussion
eval not causing any problems to me since i'm trying to eval the valid string.
I got one more thing which noticed now,
Log.Error("Error occured during evaluation of module: " + arrModules[exI]);Here,
In arrModules[exI], If arrModules is not an array then there will be a error. And tried that scenario also with below code
function testterd()
{
try
{
executeMy("ShowMessage(1)|JSwingFunctions.testtt()");
}
catch (ex)
{
Log.Error("Error" + ex.stack);
}
}
function executeMy(arrModules)
{
var temparrmodules = arrModules.split("|");
try
{
for(var exI = 0 ; exI < temparrmodules.length; exI++)
{
eval(temparrmodules[exI])
}
}
catch (ex)
{
Log.Error("Errored" + arrModules[exI],"III");
}
}
function testtt()
{
throw "error happended"
}I'll bet I know what's going on...
arrModules is not exactly an array... it's a delimited string list, correct? So, that means that arrModules[exI] doesn't return the item in that list at position exI, it returns the character in the whole STRING that is at position exI. Which means, that you could be putting a character in your log message that is messing things up.
Change that line to
Log.Error("Error occured during evaluation of module: " + aqString.GetListItem(arrModules, exI));
See if that corrects things.
- YuriPeshekhonov9 years ago
Alumni
Hi everyone,
I'm glad to announce that we created the patch which fixes this issue. Feel free to contact the Support Team and request patch 9848.
- shankar_r9 years agoCommunity Hero
I tried to re-produce this issue but i couldn't able to get it done.
If you are able re-produce this issue, Please let us know how you did that and create a support ticket for resolving this in TC.
- baxatob9 years agoCommunity Hero
Hi,
Can you show the full code of the function from where you've got an error.
- maximojo9 years agoFrequent Contributor
Anyone solve this one? I'm getting this now too but in random places in the same function. Sometimes the function works with no errors, other times
Log.Warning("blahb lah")
fails with
“Log.Warning is not a function”
I had just recently converted a jscript project to use javascript so it must be my newbieness with javascript?
- maximojo9 years agoFrequent Contributor
Submitted the support request and sent up a project to demonstrate the error.
Hopefully Smartbear will be able to shed some light on this.
- maximojo9 years agoFrequent Contributor
This is the code. Not much there but it is on a timer taking screenshots every 5 seconds.
var timeSaveFolder = "C:\\yourwebserverdirectory\\"; var pingMutex = false; function TakePingScreenshot() { if(pingMutex) return; pingMutex = true; var pic = Sys.Desktop.Picture(); // ERROR occurred on this line where ".Picture" could not be found var config = pic.CreatePictureConfiguration("PNG"); // ERROR occurred on this line where "CreatePictureConfiguration": "Call was rejected by callee." config.CompressionLevel = 9; timeSaveFolder = imageFolder + GetCurrentTimeDatePath(); if(!aqFileSystem.Exists(timeSaveFolder)) aqFileSystem.CreateFolder(timeSaveFolder) var file = timeSaveFolder + "event_" + GetTimeDate_FileNameSafe() + "-" + randAlphanumeric(3) + ".png"; if(!pic.SaveToFile(file, config)) Runner.Halt("File failed to save!"); pingMutex = false; }