Skip to content

Include message when Client Error is raised #60

Closed
@jtmiclat

Description

@jtmiclat

I was using the library and was getting 400 Client Error Exception: 400 Client Error: Bad Request for url:http....

I then had to use curl to read what the error was.

I think it would be nice to include the error message returned by Meilisearch for 400 error codes so users do not have to call the API using another library or tool to debug.

The relevant piece of code:

@staticmethod
def __validate(request):
try:
request.raise_for_status()
return HttpRequests.__to_json(request)
except requests.exceptions.HTTPError as err:
raise Exception(err)
except requests.exceptions.ConnectionError as err:
raise Exception(err)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions