From 003ddcb80901d05076f6cf59b3d96a14d9790fd3 Mon Sep 17 00:00:00 2001 From: Erick Erickson Date: Thu, 12 Jan 2012 14:56:13 +0000 Subject: [PATCH] Fix for SOLR-3022 (Plugin Loader doesn't log exceptions). See SOLR-2191 and SOLR-3032 as well. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1230573 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/solr/common/SolrException.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrException.java b/solr/solrj/src/java/org/apache/solr/common/SolrException.java index 135e5f384ee..ca52a78faf8 100644 --- a/solr/solrj/src/java/org/apache/solr/common/SolrException.java +++ b/solr/solrj/src/java/org/apache/solr/common/SolrException.java @@ -58,14 +58,11 @@ public class SolrException extends RuntimeException { public boolean logged=false; public SolrException(ErrorCode code, String msg) { - super(msg); - this.code=code.code; + this(code, msg, null, false); } public SolrException(ErrorCode code, String msg, boolean alreadyLogged) { - super(msg); - this.code=code.code; - this.logged=alreadyLogged; + this(code, msg, null, alreadyLogged); } public SolrException(ErrorCode code, String msg, Throwable th, boolean alreadyLogged) { @@ -75,13 +72,11 @@ public class SolrException extends RuntimeException { } public SolrException(ErrorCode code, String msg, Throwable th) { - this(code,msg,th,true); + this(code, msg, th, (th instanceof SolrException) ? ((SolrException)th).logged : false); } public SolrException(ErrorCode code, Throwable th) { - super(th); - this.code=code.code; - logged=true; + this(code, null, th, (th instanceof SolrException) ? ((SolrException)th).logged : false); } /**