diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2024-12-12 16:41:13 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2024-12-12 16:41:13 +0100 |
commit | 0237cc4bac0dafa9a3f3013b3f48e4f2941963bd (patch) | |
tree | 48b2fa89842b73de41bac93e24a0e3aef2bb866c /src/jwebmail/webmail.py | |
parent | 55688b969a645fbc6d94c76f51da3be976c1d098 (diff) |
fixes and improvements for error handling
Diffstat (limited to 'src/jwebmail/webmail.py')
-rw-r--r-- | src/jwebmail/webmail.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/jwebmail/webmail.py b/src/jwebmail/webmail.py index d260e8a..6c0b6c2 100644 --- a/src/jwebmail/webmail.py +++ b/src/jwebmail/webmail.py @@ -26,7 +26,7 @@ from wtforms import ( validators, ) -from .model.read_mails import QMAuthError +from .model.read_mails import JWebmailMailStorageError from .read_mails import get_read_mails_logged_in from .read_mails import login as rm_login from .render_mail import to_mime_type @@ -165,8 +165,11 @@ def readmail(msgid, folder=""): if format == "html": try: mail = read_mails.show(folder, msgid) - except QMAuthError: - return render_template("not_found.html"), 404 + except JWebmailMailStorageError as ex: + if ex.name == "InvalidMID": + return render_template("not_found.html"), 404 + else: + raise return render_template("readmail.html", msg=mail, folder=folder) |