We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a9b93c2 + 1b65c10 commit 6355d92Copy full SHA for 6355d92
1 file changed
server/mergin/app.py
@@ -389,9 +389,10 @@ def handle_exception(e):
389
def log_bad_request(response):
390
"""Log bad requests for easier debugging"""
391
if response.status_code == 400:
392
- if response.json.get("detail"):
+ json_body = response.get_json(silent=True)
393
+ if json_body and json_body.get("detail"):
394
# default response from connexion (check against swagger.yaml)
- logging.warning(f'HTTP 400: {response.json["detail"]}')
395
+ logging.warning(f'HTTP 400: {json_body["detail"]}')
396
else:
397
# either WTF form validation error or custom validation with abort(400)
398
logging.warning(f"HTTP 400: {response.data}")
0 commit comments