Apache Lucene open-source search software
Error code cleanup. Changing: SolrException( 1, ... ) to SolrException( 500, ... ) SolrException( 2, ... ) to SolrException( 400, ... )
Ryan McKinley7403608cab2d
diff --git a/src/java/org/apache/solr/schema/IndexSchema.java b/src/java/org/apache/solr/schema/IndexSchema.javaindex 32da0513c74..539af49837d 100644--- a/src/java/org/apache/solr/schema/IndexSchema.java+++ b/src/java/org/apache/solr/schema/IndexSchema.java@@ -553,7 +553,7 @@ public final class IndexSchema {} catch(Exception e) {// unexpected exception...SolrConfig.severeErrors.add( e );- throw new SolrException(1,"Schema Parsing Failed",e,false);+ throw new SolrException(500,"Schema Parsing Failed",e,false);}analyzer = new SolrIndexAnalyzer();@@ -588,7 +588,7 @@ public final class IndexSchema {NodeList nList = (NodeList)xpath.evaluate("./filter", node, XPathConstants.NODESET);if (tokNode==null){- throw new SolrException(1,"analyzer without class or tokenizer & filter list");+ throw new SolrException(500,"analyzer without class or tokenizer & filter list");}TokenizerFactory tfac = readTokenizerFactory(tokNode);@@ -598,7 +598,7 @@ public final class IndexSchema {NodeList nList = node.getChildNodes();TokenizerFactory tfac = readTokenizerFactory(nList.item(0));if (tfac==null) {- throw new SolrException(1,"TokenizerFactory must be specified first in analyzer");+ throw new SolrException(500,"TokenizerFactory must be specified first in analyzer");}******/diff --git a/src/java/org/apache/solr/update/DirectUpdateHandler.java b/src/java/org/apache/solr/update/DirectUpdateHandler.javaindex 8db3285acff..d935ac02fe5 100644--- a/src/java/org/apache/solr/update/DirectUpdateHandler.java+++ b/src/java/org/apache/solr/update/DirectUpdateHandler.java@@ -109,7 +109,7 @@ public class DirectUpdateHandler extends UpdateHandler {}protected boolean existsInIndex(String indexedId) throws IOException {- if (idField == null) throw new SolrException(2,"Operation requires schema to have a unique key field");+ if (idField == null) throw new SolrException(400,"Operation requires schema to have a unique key field");closeWriter();openSearcher();@@ -127,7 +127,7 @@ public class DirectUpdateHandler extends UpdateHandler {protected int deleteInIndex(String indexedId) throws IOException {- if (idField == null) throw new SolrException(2,"Operation requires schema to have a unique key field");+ if (idField == null) throw new SolrException(400,"Operation requires schema to have a unique key field");closeWriter(); openSearcher();IndexReader ir = searcher.getReader();diff --git a/src/java/org/apache/solr/update/UpdateHandler.java b/src/java/org/apache/solr/update/UpdateHandler.javaindex b3c66a74892..ea3c9c6d029 100644--- a/src/java/org/apache/solr/update/UpdateHandler.java+++ b/src/java/org/apache/solr/update/UpdateHandler.java@@ -73,7 +73,7 @@ public abstract class UpdateHandler implements SolrInfoMBean {commitCallbacks.add(listener);log.info("added SolrEventListener for postCommit: " + listener);} catch (Exception e) {- throw new SolrException(1,"error parsing event listevers", e, false);+ throw new SolrException(500,"error parsing event listevers", e, false);}}}@@ -88,7 +88,7 @@ public abstract class UpdateHandler implements SolrInfoMBean {optimizeCallbacks.add(listener);log.info("added SolarEventListener for postOptimize: " + listener);} catch (Exception e) {- throw new SolrException(1,"error parsing event listeners", e, false);+ throw new SolrException(500,"error parsing event listeners", e, false);}}}