From c424f0b32a94010f50ed006cccc4fcc0d0c4b85c Mon Sep 17 00:00:00 2001 From: Jake Charman Date: Fri, 18 Jul 2025 14:45:01 +0100 Subject: [PATCH] Improved logging --- src/contact.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contact.py b/src/contact.py index f725883..7902516 100755 --- a/src/contact.py +++ b/src/contact.py @@ -6,7 +6,7 @@ from flask import request, render_template from requests import post, get from uuid import uuid4 from textwrap import dedent - +from traceback import format_exc def validate_turnstile(response: str, ip: str) -> bool: turnstile_secret = environ['TURNSTILE_SECRET'] cf_response = post( @@ -25,8 +25,8 @@ def validate_turnstile(response: str, ip: str) -> bool: def send_to_discord(form: dict) -> bool: try: discord_hook = environ['DISCORD_WEBHOOK'] - except KeyError as e: - app.logger.error(e.with_traceback()) + except KeyError: + app.logger.error(format_exc()) return False discord_msg = dedent( f'''