torus
2 years agoFrequent Contributor
javascript try/catch block
I thought try/catch blocks were supposed to help you avoid failures/exceptions. That is how they work in C# and from my understanding, this is how thye work in Javascript. Why is the below code still throwing an error? If it doesn't find the process called 'someProcess' the try/catch block should catch the error ... no error should exist in the test result. However, from the following code, I get a test failure stating that "The process 'someProcess' was not found".
function testing()
{
try
{
var ml = Sys.Process("someProcess");
//ml.Close();
}
catch(e)
{}
}