Do not throw cached Exception, create new

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1673364 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-04-14 05:34:29 +00:00
parent e666070542
commit bdefedfa42
1 changed files with 3 additions and 1 deletions

View File

@ -338,7 +338,9 @@ public class PluginBag<T> implements AutoCloseable {
@Override
public T get() {
if (lazyInst != null) return lazyInst;
if (solrException != null) throw solrException;
if (solrException != null) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,"Unrecoverable error", solrException);
}
if (createInst()) {
// check if we created the instance to avoid registering it again
registerMBean(lazyInst, core, pluginInfo.name);