Skip to content

empty body causes ErrorKind::Internal #112

@mdaniel

Description

@mdaniel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bad error handlingA tag to encompass all areas where toshi does not handle errors well or correctlygood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions