empty body causes ErrorKind::Internal #112
Labels
bad error handling
A tag to encompass all areas where toshi does not handle errors well or correctly
good first issue
Good for newcomers
What happened
Accidentally omitting document content returns
500 Internal Server Error
with a body of{"message":"Internal error","uri":"/new_index"}
What was expected
Emitting any kind of helpful message would be helpful. Also, in my experience, when the client receives a 500 response, there is usually something informative on the server-side. But in this case, the server emits the same message that the client receives, which isn't helpful.
This bug is actually just the worst offender of a whole class of bugs where if something doesn't go Toshi's way, it just gives back a raspberry, but I'd say getting a 500 for an empty document is pretty far up the list for me
How to reproduce
Assuming you create an index based on the
cargo test
schema, then send in an indexing request of the form$ echo '{}' | curl ... -X PUT -d @- 127.0.0.1:9200/new_index
The text was updated successfully, but these errors were encountered: