mirror of https://github.com/apache/lucene.git
change runtime exception to service unavailable solrexception
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1455904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c64b374f96
commit
fd1e30a471
|
@ -25,6 +25,7 @@ import org.apache.lucene.index.IndexWriter;
|
||||||
import org.apache.lucene.store.AlreadyClosedException;
|
import org.apache.lucene.store.AlreadyClosedException;
|
||||||
import org.apache.solr.cloud.RecoveryStrategy;
|
import org.apache.solr.cloud.RecoveryStrategy;
|
||||||
import org.apache.solr.common.SolrException;
|
import org.apache.solr.common.SolrException;
|
||||||
|
import org.apache.solr.common.SolrException.ErrorCode;
|
||||||
import org.apache.solr.core.CoreContainer;
|
import org.apache.solr.core.CoreContainer;
|
||||||
import org.apache.solr.core.CoreDescriptor;
|
import org.apache.solr.core.CoreDescriptor;
|
||||||
import org.apache.solr.core.DirectoryFactory;
|
import org.apache.solr.core.DirectoryFactory;
|
||||||
|
@ -81,7 +82,7 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
if (closed) {
|
if (closed) {
|
||||||
throw new RuntimeException("SolrCoreState already closed");
|
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "SolrCoreState already closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (writerPauseLock) {
|
synchronized (writerPauseLock) {
|
||||||
|
@ -98,7 +99,7 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
|
||||||
} catch (InterruptedException e) {}
|
} catch (InterruptedException e) {}
|
||||||
|
|
||||||
if (closed) {
|
if (closed) {
|
||||||
throw new RuntimeException("Already closed");
|
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "Already closed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +148,7 @@ public final class DefaultSolrCoreState extends SolrCoreState implements Recover
|
||||||
} catch (InterruptedException e) {}
|
} catch (InterruptedException e) {}
|
||||||
|
|
||||||
if (closed) {
|
if (closed) {
|
||||||
throw new RuntimeException("SolrCoreState already closed");
|
throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "SolrCoreState already closed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue