A consumer of my REST API says that on occasion I am returning a 400 Bad Request - The request sent by the client was syntactically incorrect. error.>
400 Bad Request
The request sent by the client was syntactically incorrect.
You can also use abort with custom message error:
abort
from flask import abort abort(400, 'My custom message')
See https://flask-restplus.readthedocs.io/en/stable/errors.html