Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-6751: Analysis errors should return BAD_REQUEST, not SERVER_ERROR

Alan Woodward63867cb7ce86
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 1eacc8f683b..baead9f1770 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -417,6 +417,9 @@ Other Changes
* SOLR-6754: ZkController.publish doesn't use the updateLastState parameter.
(shalin)
+* SOLR-6751: Exceptions thrown in the analysis chain in DirectUpdateHandler2
+ should return a BAD_REQUEST status (Alan Woodward)
+
================== 4.10.3 ==================
Bug Fixes
diff --git a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
index e6ab8366f63..ae668871677 100644
--- a/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
+++ b/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
@@ -165,7 +165,7 @@ public class DirectUpdateHandler2 extends UpdateHandler implements SolrCoreState
} catch (SolrException e) {
throw e;
} catch (RuntimeException t) {
- throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
String.format(Locale.ROOT, "Exception writing document id %s to the index; possible analysis error.",
cmd.getPrintableId()), t);
}