MarcusSorealheis commented on pull request #42:
URL: https://github.com/apache/solr/pull/42#issuecomment-853507516
Schema Designer should not simply throw generic errors that do no help the
user. For instance, when a user tries to create a field that already exists,
there is just an error processing banner. Ideally, you could grab the important
detail in the response body and show it to the user. Consider
`data["error"]["details"][0]["errorMessages"][0]` as seen below to populate the
banner with something helpful to the user:
```
Possibly unhandled rejection:
{"data":{"responseHeader":{"status":400,"QTime":1},"error":{"metadata":["error-class","org.apache.solr.api.ApiBag$ExceptionWithErrObject","root-error-class","org.apache.solr.api.ApiBag$ExceptionWithErrObject"],"details":[{"add-field":{"stored":"true","indexed":"true","uninvertible":"true","name":"name","type":"string"},"errorMessages":["Field
'name' already exists.\n"]}],"msg":"error processing
commands","code":400}},"status":400,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","data":{"add-field":{"stored":"true","indexed":"true","uninvertible":"true","name":"name","type":"string"}},"url":"techproducts/schema","params":{"wt":"json","_":1622686070279},"headers":{"Accept":"application/json,
text/plain,
*/*","X-Requested-With":"XMLHttpRequest","Content-Type":"application/json;charset=utf-8"},"timeout":10000},"statusText":"Bad
Request","xhrStatus":"complete","resource":{"add-field":"..."}}```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]