Consensys / Mahuta

IPFS Storage service with search capability
Apache License 2.0
237 stars 49 forks source link

Unclear error message when attempting to use an index that doesn't exist. #72

Open nlko opened 5 years ago

nlko commented 5 years ago

Hello,

I tried to index some data using the index_simple method.

The server returned {"timestamp":"2019-03-26T23:07:52.367+0000","status":500,"error":"Internal Server Error","message":"no such index","path":"/mahuta/index"}.

At first I thought it was a bug in the server (because of the error 500) or maybe the url wasn't quite good (since the error is "no such index" and the url is also /index...).

Looking to the console log, I finally understood that I needed to find a way on how to create manually the index (using create_index) and that actually the message seems to come directly from elasticsearch.

It would be nice to change the error message in this particular case (maybe indicating the need to use create_index) and change also the status code to 400 (the error is on client side).

Have a good day,

Nicolas

gjeanmart commented 5 years ago

Thank you for your feedback. I started working on a better exception handling for this particular case and some other. Greg