
com.github.nicosensei.textbatch.BatchException Maven / Gradle / Ivy
/**
*
*/
package com.github.nicosensei.textbatch;
import org.apache.log4j.Level;
import com.github.nicosensei.commons.exceptions.Handleable;
/**
* Base class for all exception generated by the batch.
*
* @author ngiraud
*
*/
public abstract class BatchException extends Handleable {
private static final long serialVersionUID = 8116761541462247081L;
/**
*
* @param code
* @param messageFormat
* @param params
* @param criticity
*/
protected BatchException(
String code,
String messageFormat,
String[] params,
Level criticity) {
super(code, messageFormat, params, criticity);
}
/**
*
* @param code
* @param messageFormat
* @param params
* @param criticity
* @param cause
*/
protected BatchException(
String code,
String messageFormat,
String[] params,
Level criticity,
Throwable cause) {
super(code, messageFormat, params, criticity, cause);
}
public Throwable getRootCause() {
Throwable rootCause = this;
Throwable cause = getCause();
while (cause != null) {
rootCause = cause;
cause = cause.getCause();
}
return rootCause;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy