* responsible for throwing the exception.
*/
private DataSetInstantiationException logAndException(Throwable e, String message, Object... params)
throws DataSetInstantiationException {
String msg;
DataSetInstantiationException exn;
if (e == null) {
msg = String.format("Error instantiating data set: %s", String.format(message, params));
exn = new DataSetInstantiationException(msg);
LOG.error(msg);
} else {
msg = String.format("Error instantiating data set: %s. %s", String.format(message, params), e.getMessage());
if (e instanceof DataSetInstantiationException) {
exn = (DataSetInstantiationException) e;
} else {
exn = new DataSetInstantiationException(msg, e);
}
LOG.error(msg, e);
}
return exn;
}