mirror of https://github.com/apache/lucene.git
SOLR-4915: The root cause should be returned to the user when a SolrCore create call fails.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1492693 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e7cdd1959f
commit
af2128c683
|
@ -136,6 +136,9 @@ Bug Fixes
|
|||
if a SQLException is thrown while initializing a connection, such as in setAutoCommit(), the
|
||||
connection will not be closed. (Chris Eldredge via shalin)
|
||||
|
||||
* SOLR-4915: The root cause should be returned to the user when a SolrCore create call fails.
|
||||
(Mark Miller)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -524,9 +524,24 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
|||
SolrException.log(log, null, e);
|
||||
}
|
||||
}
|
||||
|
||||
Throwable tc = ex;
|
||||
Throwable c = null;
|
||||
do {
|
||||
tc = tc.getCause();
|
||||
if (tc != null) {
|
||||
c = tc;
|
||||
}
|
||||
} while (tc != null);
|
||||
|
||||
String rootMsg = "";
|
||||
if (c != null) {
|
||||
rootMsg = " Caused by: " + c.getMessage();
|
||||
}
|
||||
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
|
||||
"Error CREATEing SolrCore '" + name + "': " +
|
||||
ex.getMessage(), ex);
|
||||
ex.getMessage() + rootMsg, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue