SOLR-6161: Walk the entire cause chain looking for an Error

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1603708 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2014-06-19 04:32:50 +00:00
parent db8ea25a09
commit 2fbc511c38
1 changed files with 10 additions and 6 deletions

View File

@ -434,12 +434,16 @@ public class SolrDispatchFilter extends BaseSolrFilter {
}
catch (Throwable ex) {
sendError( core, solrReq, request, (HttpServletResponse)response, ex );
if (ex instanceof Error) {
throw (Error) ex;
}
if (ex.getCause() != null && ex.getCause() instanceof Error) {
log.error("An Error was wrapped in another exception - please report complete stacktrace on SOLR-6161", ex);
throw (Error) ex.getCause();
// walk the the entire cause chain to search for an Error
Throwable t = ex;
while (t != null) {
if (t instanceof Error) {
if (t != ex) {
log.error("An Error was wrapped in another exception - please report complete stacktrace on SOLR-6161", ex);
}
throw (Error) t;
}
t = t.getCause();
}
return;
} finally {