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

Varun Thacker commented on SOLR-10435:
--------------------------------------

Example:

I tried out the "create" command specified "shard" param instead of "numShards" 
param by mistake. So when I tried it I got the following error which should be 
made easier to understand to our users

{code}
~/solr-6.5.0$ curl -X POST -d '{create:{name: test_api22, config: 
gettingstarted , shards: 1 }}' http://localhost:8983/v2/c
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 400 
{metadata={error-class=org.apache.solr.api.ApiBag$ExceptionWithErrObject,root-error-class=org.apache.solr.api.ApiBag$ExceptionWithErrObject},errorMessages=[{create={name=test_api22,
 config=gettingstarted, shards=1}, errorMessages=[Expected type : string but 
found : 1in object : 1]}],msg=Error in command payload,code=400}</title>
</head>
<body><h2>HTTP ERROR 400</h2>
<p>Problem accessing /solr/____v2/c. Reason:
<pre>    
{metadata={error-class=org.apache.solr.api.ApiBag$ExceptionWithErrObject,root-error-class=org.apache.solr.api.ApiBag$ExceptionWithErrObject},errorMessages=[{create={name=test_api22,
 config=gettingstarted, shards=1}, errorMessages=[Expected type : string but 
found : 1in object : 1]}],msg=Error in command payload,code=400}</pre></p>
</body>
</html>
{code}


> homogenise syntax error and API errors in v2 API
> ------------------------------------------------
>
>                 Key: SOLR-10435
>                 URL: https://issues.apache.org/jira/browse/SOLR-10435
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: v2 API
>            Reporter: Noble Paul
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to