Skip to content

v5.0.0.0-handle-api-errors

Choose a tag to compare

@GitauHarrison GitauHarrison released this 14 Oct 23:45
· 7 commits to main since this release

The "400 Bad Request" error is the most common API error. It comes about when a client sends a request with invalid data. Create a dedicated method used to handle this type of error.

The error message contains a short description of the error, plus an optional error message.

{
    "error": "short error description",
    "message": "error message"
}

Flask should return a JSON response to the error.