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

David Smiley commented on SOLR-11631:
-------------------------------------

Similar issue... I'm creating a test in SOLR-11542 which calls this:
{code:java}
solrClient.request(new V2Request.Builder("/collections/" + configName + 
"/config/params")
        .withMethod(SolrRequest.METHOD.POST)
        .withPayload("{" +
            "  'set' : {" +
            "    '_UPDATE' : {'processor':'inc,tolerant'}" +
            "  }" +
            "}").build());
{code}
I originally messed up and used 'update' instead of 'set' in the JSON, and this 
request completed without throwing an exception. So now I wrap this with:
{code:java}
  private void checkNoError(NamedList<Object> response) {
    Object errors = response.get("errorMessages");
    assertNull("" + errors, errors);
  }
{code}
Which I think kinda sucks.  Also notice the inconsistency in names... 
"errorMessages" here whereas "errors" for schema API.

> Schema API always has status 0
> ------------------------------
>
>                 Key: SOLR-11631
>                 URL: https://issues.apache.org/jira/browse/SOLR-11631
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Steve Rowe
>         Attachments: SOLR-11631.patch
>
>
> Schema API failures always return status=0.
> Consumers should be able to detect failure using normal mechanisms (i.e. 
> status != 0) rather than having to parse the response for "errors".  Right 
> now if I attempt to {{add-field}} an already existing field, I get:
> {noformat}
> {responseHeader={status=0,QTime=XXX},errors=[{add-field={name=YYY, ...}, 
> errorMessages=[Field 'YYY' already exists.]}]}
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to