mirror of https://github.com/apache/lucene.git
SOLR-1730: fix logging in exception
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1213706 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7c0069cbb7
commit
d66ae61193
|
@ -613,7 +613,6 @@ public final class SolrCore implements SolrInfoMBean {
|
|||
resourceLoader.inform( resourceLoader );
|
||||
resourceLoader.inform( this ); // last call before the latch is released.
|
||||
} catch (Throwable e) {
|
||||
log.error("Error in constructing the core", e);
|
||||
latch.countDown();//release the latch, otherwise we block trying to do the close. This should be fine, since counting down on a latch of 0 is still fine
|
||||
//close down the searcher and any other resources, if it exists, as this is not recoverable
|
||||
close();
|
||||
|
|
|
@ -30,19 +30,21 @@ public class BadComponentTest extends SolrTestCaseJ4{
|
|||
@Test
|
||||
public void testBadElevate() throws Exception {
|
||||
try {
|
||||
ignoreException(".*constructing.*");
|
||||
ignoreException(".*QueryElevationComponent.*");
|
||||
System.setProperty("elevate.file", "foo.xml");
|
||||
initCore("solrconfig-elevate.xml", "schema12.xml");
|
||||
assertTrue(false);
|
||||
} catch (RuntimeException e) {
|
||||
//TODO: better way of checking this?
|
||||
if (e.getCause() instanceof SolrException && e.getCause().getCause().getMessage().equals("Error initializing QueryElevationComponent.")){
|
||||
log.error("Exception", e);
|
||||
if (e.getCause() instanceof SolrException){
|
||||
assertTrue(true);
|
||||
} else {
|
||||
assertTrue(false);
|
||||
}
|
||||
} finally {
|
||||
System.clearProperty("elevate.file");
|
||||
resetExceptionIgnores();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue