Improve error messaging on 400
We were debugging a 400 error which was caused by a trailing comma in the post body. Was hard to spot and the error message was really opaque. Would be nice to catch this and return an error saying the body was invalid JSON.
def post(self):
args = request.get_json()
errors = self.schema.validate(args)
if errors:
abort(400, message=str(errors))
I assume it's actually aborting 400 at the args = request.get_json()
line so it would need a try/except around there in each endpoint