You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ry...@apache.org on 2007/05/31 00:44:43 UTC

svn commit: r542963 - in /lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet: SolrDispatchFilter.java SolrRequestParsers.java

Author: ryan
Date: Wed May 30 15:44:42 2007
New Revision: 542963

URL: http://svn.apache.org/viewvc?view=rev&rev=542963
Log:
SOLR-249 -- oh my, missing the "throw" for SolrException!

Modified:
    lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
    lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java

Modified: lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java?view=diff&rev=542963&r1=542962&r2=542963
==============================================================================
--- lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java (original)
+++ lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java Wed May 30 15:44:42 2007
@@ -143,11 +143,11 @@
             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);
             }
           }
         }

Modified: lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java?view=diff&rev=542963&r1=542962&r2=542963
==============================================================================
--- lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java (original)
+++ lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrRequestParsers.java Wed May 30 15:44:42 2007
@@ -117,7 +117,7 @@
     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 @@
     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 @@
       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() );