From 97d0cd927eb108d6970fa7e973e8be89c439c2eb Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 4 Apr 2000 23:12:50 +0000 Subject: 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. --- Mailman/Cgi/private.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Mailman/Cgi/private.py') diff --git a/Mailman/Cgi/private.py b/Mailman/Cgi/private.py index f0c206916..750e2d8bd 100644 --- a/Mailman/Cgi/private.py +++ b/Mailman/Cgi/private.py @@ -104,7 +104,7 @@ def main(): doc.AddItem(Header(3, "You must specify a list.")) print doc.Format(bgcolor="#FFFFFF") sys.exit(0) - list_name = string.lower(list_info[0]) + listname = string.lower(list_info[0]) # If it's a directory, we have to append index.html in this script. We # must also check for a gzipped file, because the text archives are @@ -117,14 +117,14 @@ def main(): true_filename = true_filename + '.gz' try: - listobj = MailList.MailList(list_name, lock=0) - except Errors.MMUnknownListError: - listobj = None - if not (listobj and listobj._ready): - msg = "%s: No such list." % list_name + listobj = MailList.MailList(listname, lock=0) + listobj.IsListInitialized() + except Errors.MMListError, e: + msg = 'No such list %s' % listname doc.SetTitle("Private Archive Error - %s" % msg) doc.AddItem(Header(2, msg)) print doc.Format(bgcolor="#FFFFFF") + sys.stderr.write('No such list "%s": %s\n' % (listname, e)) sys.exit(0) form = cgi.FieldStorage() -- cgit v1.2.3-70-g09d2