diff options
| author | bwarsaw | 2001-02-15 07:22:20 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-02-15 07:22:20 +0000 |
| commit | 1f8037b8050c0cb6e6b0105e59740958b785b844 (patch) | |
| tree | 49d6ad0e7323d455f048d3b63472276cf568ee66 /Mailman/Errors.py | |
| parent | 62f3298f2ee8019e89854715597746c9de1db957 (diff) | |
| download | mailman-1f8037b8050c0cb6e6b0105e59740958b785b844.tar.gz mailman-1f8037b8050c0cb6e6b0105e59740958b785b844.tar.zst mailman-1f8037b8050c0cb6e6b0105e59740958b785b844.zip | |
HandlerError, MessageHeld, DiscardMessage, SomeRecipientsFailed,
LoopError: all error classes are now moved here.
Diffstat (limited to 'Mailman/Errors.py')
| -rw-r--r-- | Mailman/Errors.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/Mailman/Errors.py b/Mailman/Errors.py index 052bcd1d8..a90a82428 100644 --- a/Mailman/Errors.py +++ b/Mailman/Errors.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc. +# Copyright (C) 1998,1999,2000,2001 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 @@ -17,7 +17,10 @@ """Shared mailman errors and messages.""" +import Mailman.i18n + + # exceptions for problems related to opening a list class MMListError(Exception): pass class MMUnknownListError(MMListError): pass @@ -89,3 +92,30 @@ class MMHostileAddress(EmailAddressError): class LostHeldMessage(MailmanError): """Held message was lost.""" pass + + + +# Exceptions for the Handler subsystem +class HandlerError(MailmanError): + """Base class for all handler errors.""" + +class MessageHeld(HandlerError): + """Base class for all message-being-held short circuits.""" + def __str__(self): + return self.__class__.__doc__ + + # funky spelling is necessary to break import loops + rejection = Mailman.i18n._('Your message was rejected') + + def rejection_notice(self, mlist): + return self.__class__.rejection + +class DiscardMessage(HandlerError): + """The message can be discarded with no further action""" + +class SomeRecipientsFailed(HandlerError): + """Delivery to some or all recipients failed""" + +# multiple inheritance for backwards compatibility +class LoopError(DiscardMessage, MMLoopingPost): + """We've seen this message before""" |
