Skip to content

Apache Lucene open-source search software

improve exception handling messages, don't rewrap SolrException

Yonik Seeleycceaa41fc616
diff --git a/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java b/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
index b43b37c0ad1..a1ad8fc12fc 100644
--- a/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
+++ b/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
@@ -298,10 +298,13 @@ public class DocumentBuilder {
boost = docBoost;
}
}
+ catch( SolrException ex ) {
+ throw ex;
+ }
catch( Exception ex ) {
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,
"ERROR: "+getID(doc, schema)+"Error adding field '" +
- field.getName() + "'='" +field.getValue()+"'", ex );
+ field.getName() + "'='" +field.getValue()+"' msg=" + ex.getMessage(), ex );
}
// make sure the field was used somehow...