public Throwable getRollbackFailure() {
if (rollbackResult == null) {
return null;
}
else if (rollbackResult.isCancelled()) {
return new RollbackCancelledException("Rollback was cancelled");
}
else if (rollbackResult.isRolledBack()) {
return new RollbackCancelledException("Rollback was itself rolled back");
}
else if (rollbackResult.isTimedOut()) {
return new RollbackCancelledException("Rollback timed out");
}
else {
return rollbackResult.getFailureResult();
}
}