Use the keyword throw inside the catch block to stop the script from further excutionexecution, upon any failure/exception. try { //code to test } catch (Exception e) { throw new AssertionError("A clear description of the failure", e); }
try
{
//code to test
}
catch (Exception e)
{
throw new AssertionError("A clear description of the failure", e);
}