summaryrefslogtreecommitdiff
path: root/Mailman/Cgi/edithtml.py
diff options
context:
space:
mode:
authorbwarsaw2000-04-04 23:12:50 +0000
committerbwarsaw2000-04-04 23:12:50 +0000
commit97d0cd927eb108d6970fa7e973e8be89c439c2eb (patch)
treeff3c814fe7000725a87c2625e4e3e5089ad9a485 /Mailman/Cgi/edithtml.py
parent85ff1df49be81af31a33f466ac7ab424fe00cad8 (diff)
downloadmailman-97d0cd927eb108d6970fa7e973e8be89c439c2eb.tar.gz
mailman-97d0cd927eb108d6970fa7e973e8be89c439c2eb.tar.zst
mailman-97d0cd927eb108d6970fa7e973e8be89c439c2eb.zip
Some meager consistency in handling errors when trying to open the
mailing list. In all cases, catch the base exception class MMListError, and output HTML indicating the specified list doesn't exist. A more detail message gets printed to logs/error (the str() of the actual exception details). Also: admin.py - Don't catch MMBadConfigError around mlist.parse_matching_header_opt() since this method doesn't ever raise that exception. Actually, that exception isn't raised anywhere in Mailman, so it's been removed.
Diffstat (limited to 'Mailman/Cgi/edithtml.py')
-rw-r--r--Mailman/Cgi/edithtml.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Mailman/Cgi/edithtml.py b/Mailman/Cgi/edithtml.py
index 8f9e54b4b..70c5da036 100644
--- a/Mailman/Cgi/edithtml.py
+++ b/Mailman/Cgi/edithtml.py
@@ -16,11 +16,13 @@
"""Script which implements admin editing of the list's html templates."""
+import sys
import os
import cgi
import string
-from Mailman import Utils, MailList
+from Mailman import Utils
+from Mailman import MailList
from Mailman.htmlformat import *
from Mailman.HTMLFormatter import HTMLFormatter
from Mailman import Errors
@@ -48,9 +50,10 @@ def main():
listname = string.lower(parts[0])
try:
mlist = MailList.MailList(listname, lock=0)
- except (Errors.MMUnknownListError, Errors.MMListNotReady):
- doc.AddItem(Header(2, "%s : No such list" % listname))
+ except Errors.MMListError, e:
+ doc.AddItem(Header(2, 'No such list <em>%s</em>' % listname))
print doc.Format(bgcolor='#ffffff')
+ sys.stderr.write('No such list "%s": %s\n' % (listname, e))
return
# get the list._template_dir attribute