You can do one thing Implement ITestListener class. Implement onTestFailure message as shown. At the end when you have got all the necessary information from the throwable object, you can set the result to (1) based on your condition which will make the test pass if you wish to.
@Override
public void onTestFailure(ITestResult result)
{
// TODO Auto-generated method stub
System.out.println("Test Failed.");
System.out.println(result.getThrowable());
result.getThrowable().getStackTrace();
result.getThrowable().getMessage();
result.setStatus(1);
}