mirror of https://github.com/apache/lucene.git
Error code cleanup. Changing:
SolrException( 1, ... ) to SolrException( 500, ... ) SolrException( 2, ... ) to SolrException( 400, ... ) Now, the only status codes set in SolrExceptions are valid HTTP status codes: 500 400 503 404 git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@542461 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a92abb20e3
commit
7403608cab
|
@ -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");
|
||||
}
|
||||
******/
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue