cli icon indicating copy to clipboard operation
cli copied to clipboard

Print actual error on 400 Bad Request

Open margold opened this issue 1 year ago • 0 comments

In case when a request fails due to json validation, the response contains a path field:

400 Bad Request
{"status": "error", "message": "\'\' is too short", "path": "$.comments[0].messages[0].from"}

CLI currently only prints the message, which is uninformative on its own and does not help a casual user fix their request. It should also print the path if it's available (fine to assume that it's only available on 400 Bad Request responses).

margold avatar Jun 25 '24 13:06 margold