Better exception error message for what may be a common startup problem

git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@380206 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2006-02-23 19:47:00 +00:00
parent 3bd4668a16
commit 53ad895510
1 changed files with 5 additions and 3 deletions

View File

@ -28,13 +28,15 @@ public class SolrConfig {
static {
Exception e=null;
String file="solrconfig.xml";
InputStream is;
InputStream is=null;
try {
is = Config.openResource(file);
} catch (Exception ee) {
e=ee;
file = "solarconfig.xml"; // backward compat
is = Config.openResource(file);
try {
is = Config.openResource(file);
} catch (Exception eee) {}
}
if (is!=null) {
try {
@ -45,7 +47,7 @@ public class SolrConfig {
}
Config.log.info("Loaded Config solrconfig.xml");
} else {
throw new RuntimeException(e);
throw new RuntimeException("Can't find Solr config file ./conf/solrconfig.xml",e);
}
}
}