Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions server/mergin/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,10 @@ def handle_exception(e):
def log_bad_request(response):
"""Log bad requests for easier debugging"""
if response.status_code == 400:
if response.json.get("detail"):
json_body = response.get_json(silent=True)
if json_body and json_body.get("detail"):
# default response from connexion (check against swagger.yaml)
logging.warning(f'HTTP 400: {response.json["detail"]}')
logging.warning(f'HTTP 400: {json_body["detail"]}')
else:
# either WTF form validation error or custom validation with abort(400)
logging.warning(f"HTTP 400: {response.data}")
Expand Down
Loading