From 3e69d39aef0d5cdc1d7c603479a6dc0ff4b37b66 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sun, 2 Oct 2022 15:12:19 -0400 Subject: [PATCH] Adjust error email formatting. --- undercover/email.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/undercover/email.py b/undercover/email.py index b48061f..96f9baa 100644 --- a/undercover/email.py +++ b/undercover/email.py @@ -46,6 +46,7 @@ Or copy and paste this link into your browser: {reset_link} def exception_alert(e: Exception): + exception_text = 'Exception Message: ' + str(e) + '\n' + ''.join(traceback.format_exception(None, e, e.__traceback__)) data = { 'Messages': [ { @@ -55,7 +56,8 @@ def exception_alert(e: Exception): }, "To": [{"Email": "sage@sagev.space"}], "Subject": "UnderCover Internal Error", - "TextPart": str(e) + '\n' + ''.join(traceback.format_exception(None, e, e.__traceback__)), + "TextPart": exception_text, + "HTMLPart": f"
{exception_text}
", "CustomID": "InternalServerError" } ]