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

Munendra S N commented on SOLR-12427:
-------------------------------------

[~gerlowskija]
Thanks for looking into this.

* I didn't find a good place to add the test. So, I have added it in 
_TestGroupingSearch_ (As grouping also goes through the same code block). 
Please move it to a better place.

* While working on this, I have observed that 
In *params.getInt(String param)*, when an exception is thrown the error message 
doesn't include for which param it has failed. (This is true for all number 
conversions in SolrParams)

This can be changed to something like this. This helps user as it is more 
verbose.
{code:java}
  public Integer getInt(String param) {
    String val = get(param);
    try {
      return val==null ? null : Integer.valueOf(val);
    }
    catch( Exception ex ) {
      throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "for param" 
+ param + "error" + ex.getMessage(), ex );
    }
  }
{code}
I haven't made the change in this patch because the change is not related to 
this issue. Probably it should be covered separately. 

> Status 500 on Incorrect value for start and rows
> ------------------------------------------------
>
>                 Key: SOLR-12427
>                 URL: https://issues.apache.org/jira/browse/SOLR-12427
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Munendra S N
>            Assignee: Jason Gerlowski
>            Priority: Trivial
>         Attachments: SOLR-12427.patch, SOLR-12427.patch
>
>
> With SOLR-7254, 
> Cases, when start and rows are negatives, was handled but the case when an 
> invalid value is passed is not handled.
> Hence, Solr returns 500. It is better to return 400, as it is the client error



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to