thelabdude edited a comment on pull request #42:
URL: https://github.com/apache/solr/pull/42#issuecomment-853963136


   > 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":"..."}}``
 `
   > ```
   
   Can you please provide reproduction steps for how you got this error 
(including browser details)? Schema Designer UI should be displaying user 
friendly errors in a dialog. Moreover, I don't even know how you got this error 
since the JS code validates the field doesn't already exist before submitting 
the request. See screenshot of what I see in my env. <img width="357" 
alt="Screen Shot 2021-06-03 at 9 32 19 AM" 
src="https://user-images.githubusercontent.com/417074/120671957-1c3aad00-c44f-11eb-8c62-ff6051ba9316.png";>


-- 
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:
us...@infra.apache.org



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

Reply via email to