[ 
https://issues.apache.org/jira/browse/SOLR-18112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069766#comment-18069766
 ] 

David Smiley commented on SOLR-18112:
-------------------------------------

Ah, a Nightly test.  Shouldn't searchNonExistingCollection simply look for 
status code 404?  I like that better than creating constants for error 
messages, honestly.  If you agree, I'll push a quick fix:

{code:java}
    private void searchNonExistingCollection() {
      try {
        solrClient.query(collectionName, new SolrQuery("*"));
      } catch (RemoteSolrException e) {
        if (e.code() != 404) {
          addFailure(e);
        }
      } catch (Exception e) {
        addFailure(e);
      }
    }
{code}

If only modern Java "pattern matching" could be applied to catch blocks, this 
would be more elegant.  Or even if  the catch statement could have something 
like {{} catch (RemoteSolrException e && e.code() != 404) {}}

> Convert SolrDispatchFilter to a Servlet
> ---------------------------------------
>
>                 Key: SOLR-18112
>                 URL: https://issues.apache.org/jira/browse/SOLR-18112
>             Project: Solr
>          Issue Type: Improvement
>          Components: Server
>            Reporter: David Smiley
>            Assignee: David Smiley
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 10.1
>
>         Attachments: 
> SOLR-18112__fix_ConcurrentDeleteAndCreateCollectionTest_due_to_changed_error_msg.patch
>
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> SolrDispatchFilter ought to be an HttpServlet, not an HttpFilter.  It may 
> simplify things internally... but really this is a principled change.
> An example of something simpler would be that it'll be easy to ensure that 
> the actual filters target only Solr and not any other Servlets that someone 
> might want to add.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to