Class<? extends SliderProviderFactory> providerClass;
try {
providerClass = conf.getClass(providerKey, null, SliderProviderFactory.class);
} catch (RuntimeException e) {
throw new BadClusterStateException(e, "Failed to load provider %s: %s", application, e);
}
if (providerClass == null) {
throw new BadClusterStateException(PROVIDER_NOT_FOUND, application);
}
Exception ex;
try {
SliderProviderFactory providerFactory = providerClass.newInstance();
providerFactory.setConf(conf);
return providerFactory;
} catch (Exception e) {
ex = e;
}
//by here the operation failed and ex is set to the value
throw new BadClusterStateException(ex,
"Failed to create an instance of %s : %s",
providerClass,
ex);
}