summaryrefslogtreecommitdiff
path: root/Mailman/Errors.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-08-05 22:49:04 -0500
committerBarry Warsaw2007-08-05 22:49:04 -0500
commit89bdaec5c735ffb2b27cc29620cb01b451b72550 (patch)
tree61c6fa40eb1d3e267475430005b50ecf44b46512 /Mailman/Errors.py
parente0abca9fbdde530f7517396677c87f19c86bc0c6 (diff)
downloadmailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.tar.gz
mailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.tar.zst
mailman-89bdaec5c735ffb2b27cc29620cb01b451b72550.zip
Diffstat (limited to 'Mailman/Errors.py')
-rw-r--r--Mailman/Errors.py29
1 files changed, 24 insertions, 5 deletions
diff --git a/Mailman/Errors.py b/Mailman/Errors.py
index f3f7671e8..99065ddbe 100644
--- a/Mailman/Errors.py
+++ b/Mailman/Errors.py
@@ -162,11 +162,30 @@ class RejectMessage(HandlerError):
-# Additional exceptions
-class HostileSubscriptionError(MailmanError):
- """A cross-subscription attempt was made."""
- # This exception gets raised when an invitee attempts to use the
- # invitation to cross-subscribe to some other mailing list.
+# Subscription exceptions
+class SubscriptionError(MailmanError):
+ """Subscription errors base class."""
+
+
+class HostileSubscriptionError(SubscriptionError):
+ """A cross-subscription attempt was made.
+
+ This exception gets raised when an invitee attempts to use the
+ invitation to cross-subscribe to some other mailing list.
+ """
+
+
+class AlreadySubscribedError(SubscriptionError):
+ """The member is already subscribed to the mailing list with this role."""
+
+ def __init__(self, fqdn_listname, address, role):
+ self._fqdn_listname = fqdn_listname
+ self._address = address
+ self._role = role
+
+ def __str__(self):
+ return '%s is already a %s of mailing list %s' % (
+ self._address, self._role, self._fqdn_listname)