Skip to main content
formatting
Source Link
Bharat Mane
  • 6.8k
  • 11
  • 41
  • 69

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);
}

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

Use the keyword throw inside the catch block to stop the script from further execution, upon any failure/exception.

try
{
//code to test
}
catch (Exception e)
{
throw new AssertionError("A clear description of the failure", e);
}
Source Link

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