* @param ex
* the cause of the failure
* @return an {@link ExitStatus}
*/
protected ExitStatus getDefaultExitStatusForFailure(Throwable ex, JobExecution execution) {
ExitStatus exitStatus;
if (ex instanceof JobInterruptedException
|| ex.getCause() instanceof JobInterruptedException) {
exitStatus = ExitStatus.STOPPED
.addExitDescription(JobInterruptedException.class.getName());
} else if (ex instanceof NoSuchJobException
|| ex.getCause() instanceof NoSuchJobException) {
exitStatus = new ExitStatus(ExitCodeMapper.NO_SUCH_JOB, ex
.getClass().getName());
} else {
exitStatus = ExitStatus.FAILED.addExitDescription(ex);
}