Skip to content

add_document method doesn't give access to missing_payload error when empty string is send #585

@alallema

Description

@alallema

Description
When trying to add an empty string document in Meilisearch the error message should be:

{
	"message": "A json payload is missing.",
	"code": "missing_payload",
	"type": "invalid_request",
	"link": "https://docs.meilisearch.com/errors#missing_payload"
}

Expected behavior
Receive a formal message for this case from Meilisearch API.

Current behavior
The following error message is received when the method is used in this way:

client.index('movies').add_documents('')
{
	"message": "The 'json' payload provided is malformed. Couldn't serialize document value: data did not match any variant of untagged enum Either.",
	"code": "malformed_payload",
	"type": "invalid_request",
	"link": "https://docs.meilisearch.com/errors#malformed_payload"
}

Environment (please complete the following information):

  • Meilisearch version: v.0.29.1
  • meilisearch-python version: v0.22.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions