root / trunk / turbomail / exceptions.py

Revision 117, 1.3 kB (checked in by fs, 2 months ago)

renamed providers to transports which reflects the real purpose better

  • Property svn:keywords set to Revision
Line 
1# encoding: utf-8
2
3"""Exceptions used by TurboMail to report common errors."""
4
5__version__ = "$Revision$"
6__all__ = ['MailException', 'MailNotEnabledException', 'MailConfigurationException',
7           'TransportException', 'TransportExhaustedException', 'ManagerException']
8
9
10class MailException(Exception):
11    """The base for all TurboMail exceptions."""
12   
13    pass
14
15
16class MailNotEnabledException(MailException):
17    """Attempted to use TurboMail before being enabled."""
18   
19    def __str__(self):
20        return "An attempt was made to use a facility of the TurboMail " \
21               "framework but outbound mail hasn't been enabled in the " \
22               "config file [via mail.on]."
23
24
25class MailConfigurationException(MailException):
26    """There was an error in the configuration of TurboMail."""
27   
28    pass
29
30
31class TransportException(MailException):
32    """The base for all TurboMail Transport exceptions."""
33   
34    pass
35
36
37class TransportExhaustedException(MailException):
38    """Attempted to use TurboMail before being enabled."""
39   
40    def __str__(self):
41        return "This Transport instance is no longer capable of delivering mail."
42
43
44class ManagerException(MailException):
45    """The base for all TurboMail Manager exceptions."""
46   
47    pass
Note: See TracBrowser for help on using the browser.