Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-249 -- oh my, missing the "throw" for SolrException!

Ryan McKinley7e7b3f765ba2
diff --git a/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java b/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
index e0c5354ffc8..2f3d0420515 100644
--- a/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
+++ b/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
@@ -143,11 +143,11 @@ public class SolrDispatchFilter implements Filter
solrReq = parsers.parse( path, req );
String qt = solrReq.getParams().get( SolrParams.QT );
if( qt != null && qt.startsWith( "/" ) ) {
- new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Invalid query type. Do not use /select to access: "+qt);
+ throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Invalid query type. Do not use /select to access: "+qt);
}
handler = core.getRequestHandler( qt );
if( handler == null ) {
- new SolrException( SolrException.ErrorCode.BAD_REQUEST, "unknown handler: "+qt);
+ throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "unknown handler: "+qt);
}
}
}
diff --git a/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java b/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java
index a4c186336c3..c386219f686 100644
--- a/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java
+++ b/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java
@@ -117,7 +117,7 @@ public class SolrRequestParsers
String[] strs = params.getParams( SolrParams.STREAM_URL );
if( strs != null ) {
if( !enableRemoteStreams ) {
- new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Remote Streaming is disabled." );
+ throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Remote Streaming is disabled." );
}
for( final String url : strs ) {
ContentStreamBase stream = new ContentStreamBase.URLStream( new URL(url) );
@@ -132,7 +132,7 @@ public class SolrRequestParsers
strs = params.getParams( SolrParams.STREAM_FILE );
if( strs != null ) {
if( !enableRemoteStreams ) {
- new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Remote Streaming is disabled." );
+ throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Remote Streaming is disabled." );
}
for( final String file : strs ) {
ContentStreamBase stream = new ContentStreamBase.FileStream( new File(file) );
@@ -303,7 +303,7 @@ class MultipartRequestParser implements SolrRequestParser
final HttpServletRequest req, ArrayList<ContentStream> streams ) throws Exception
{
if( !ServletFileUpload.isMultipartContent(req) ) {
- new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Not multipart content! "+req.getContentType() );
+ throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Not multipart content! "+req.getContentType() );
}
MultiMapSolrParams params = SolrRequestParsers.parseQueryString( req.getQueryString() );