"Fossies" - the Fresh Open Source Software Archive

Member "getmail-5.16/getmailcore/exceptions.py" (31 Oct 2021, 2354 Bytes) of package /linux/misc/getmail-5.16.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "exceptions.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.15_vs_5.16.

    1 #!/usr/bin/env python2
    2 '''Exceptions raised by getmail.
    3 '''
    4 
    5 __all__ = [
    6     'getmailError',
    7     'getmailConfigurationError',
    8     'getmailDnsLookupError',
    9     'getmailDnsServerFailure',
   10     'getmailOperationError',
   11     'getmailFilterError',
   12     'getmailRetrievalError',
   13     'getmailDeliveryError',
   14     'getmailCredentialError',
   15     'getmailLoginRefusedError',
   16     'getmailMailboxSelectError',
   17 ]
   18 
   19 # Base class for all getmail exceptions
   20 class getmailError(StandardError):
   21     '''Base class for all getmail exceptions.'''
   22     pass
   23 
   24 # Specific exception classes
   25 class getmailConfigurationError(getmailError):
   26     '''Exception raised when a user configuration error is detected.'''
   27     pass
   28 
   29 class getmailOperationError(getmailError):
   30     '''Exception raised when a runtime error is detected.'''
   31     pass
   32 
   33 class getmailRetrievalError(getmailOperationError):
   34     '''Exception raised when a server (cough MSExchange cough) fails to 
   35     hand over a message it claims to have.'''
   36     pass
   37 
   38 class getmailFilterError(getmailOperationError):
   39     '''Exception raised when problems occur during message filtering.
   40     Subclass of getmailOperationError.
   41     '''
   42     pass
   43 
   44 class getmailDeliveryError(getmailOperationError):
   45     '''Exception raised when problems occur during message delivery.
   46     Subclass of getmailOperationError.
   47     '''
   48     pass
   49 
   50 class getmailDnsError(getmailOperationError):
   51     '''Base class for errors looking up hosts in DNS to connect to.'''
   52     pass
   53 
   54 class getmailDnsLookupError(getmailDnsError):
   55     '''No such DNS name, or name found but no address records for it.'''
   56     pass
   57 
   58 class getmailDnsServerFailure(getmailDnsError):
   59     '''DNS server failed when trying to look up name.'''
   60     pass
   61     
   62 class getmailCredentialError(getmailOperationError):
   63     '''Error raised when server says "bad password", "no such user", etc
   64     (when that is possible to detect).'''
   65     pass
   66 
   67 class getmailLoginRefusedError(getmailOperationError):
   68     '''Error raised when the server is just refusing logins due to reasons
   69     other than credential problems (when that is possible to detect):  server
   70     too busy, service shutting down, etc.'''
   71     pass
   72 
   73 class getmailMailboxSelectError(getmailOperationError):
   74     '''Error raised when the server responds NO to an (IMAP) select mailbox
   75     command -- no such mailbox, no permissions, etc.
   76     '''
   77     pass