mthmulders / mcs

Search the Maven Central Repository from your command line!

Home Page:https://maarten.mulders.it/projects/mcs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid Solr query is handled with stacktrace

mthmulders opened this issue · comments

Any invalid query leads to a user-visible stack trace. That's not a clean way to deal with errors.
This probably applies to server-side errors, too.

If mcs submits a malformed Solr query (e.g. with curl -v "https://search.maven.org/solrsearch/select?q=g%3Aorg.codehaus.plexus+AND+a%3Aplexus-utils+AND+v%3A*&core=gav&start=0&rows=20"), the exchange looks like this:

> GET /solrsearch/select?q=g%3Aorg.codehaus.plexus+AND+a%3Aplexus-utils+AND+v%3A*&core=gav&start=0&rows=20 HTTP/2
> Host: search.maven.org
> user-agent: curl/7.77.0
> accept: */*
> 

< HTTP/2 400 
< date: Fri, 11 Feb 2022 09:31:37 GMT
< content-type: text/plain
< content-length: 24
< server: nginx
< 
* Connection #0 to host search.maven.org left intact
Solr returned 400, msg: