From 5c21f02b0d2f4de7cf99b4b0bd8b522853156eac Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 22 Nov 2008 18:24:58 -0500 Subject: String exceptions -> class exceptions. --- Mailman/Errors.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Mailman/Errors.py') diff --git a/Mailman/Errors.py b/Mailman/Errors.py index 2e80f21a..5b377846 100644 --- a/Mailman/Errors.py +++ b/Mailman/Errors.py @@ -49,14 +49,13 @@ class MMCookieError(MMAuthenticationError): pass class MMExpiredCookieError(MMCookieError): pass class MMInvalidCookieError(MMCookieError): pass -# BAW: these still need to be converted to classes. -MMMustDigestError = "MMMustDigestError" -MMCantDigestError = "MMCantDigestError" -MMNeedApproval = "MMNeedApproval" -MMSubscribeNeedsConfirmation = "MMSubscribeNeedsConfirmation" -MMBadConfirmation = "MMBadConfirmation" -MMAlreadyDigested = "MMAlreadyDigested" -MMAlreadyUndigested = "MMAlreadyUndigested" +class MMMustDigestError: pass +class MMCantDigestError: pass +class MMNeedApproval: pass +class MMSubscribeNeedsConfirmation: pass +class MMBadConfirmation: pass +class MMAlreadyDigested: pass +class MMAlreadyUndigested: pass MODERATED_LIST_MSG = "Moderated list" IMPLICIT_DEST_MSG = "Implicit destination" -- cgit v1.2.3 From c0da6af58657b1fe5730d3dea0e78bc17dac490a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 20 Jan 2009 12:22:08 -0800 Subject: Two of the 'new' class exceptions are raised with an argument. --- Mailman/Errors.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Mailman/Errors.py') diff --git a/Mailman/Errors.py b/Mailman/Errors.py index 5b377846..d4af216e 100644 --- a/Mailman/Errors.py +++ b/Mailman/Errors.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,7 +12,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. """Shared mailman errors and messages.""" @@ -51,9 +52,17 @@ class MMInvalidCookieError(MMCookieError): pass class MMMustDigestError: pass class MMCantDigestError: pass -class MMNeedApproval: pass +class MMNeedApproval: + def __init__(self, message=None): + self.message = message + def __str__(self): + return self.message or '' class MMSubscribeNeedsConfirmation: pass -class MMBadConfirmation: pass +class MMBadConfirmation: + def __init__(self, message=None): + self.message = message + def __str__(self): + return self.message or '' class MMAlreadyDigested: pass class MMAlreadyUndigested: pass -- cgit v1.2.3