VirtualMailManager/errors.py
branchv0.6.x
changeset 216 0c8c053b451c
parent 214 84e6e898e6c5
child 320 011066435e6f
equal deleted inserted replaced
215:33f727efa7c4 216:0c8c053b451c
       
     1 # -*- coding: UTF-8 -*-
       
     2 # Copyright (c) 2007 - 2010, Pascal Volk
       
     3 # See COPYING for distribution information.
       
     4 
       
     5 """
       
     6     VirtualMailManager.errors
       
     7 
       
     8     VMM's Exception classes
       
     9 """
       
    10 
       
    11 
       
    12 class VMMError(Exception):
       
    13     """Exception base class for VirtualMailManager exceptions"""
       
    14 
       
    15     def __init__(self, msg, code):
       
    16         Exception.__init__(self, msg)
       
    17         self.msg = msg
       
    18         self.code = int(code)
       
    19 
       
    20     def __repr__(self):
       
    21         return '%s(%r, %r)' % (self.__class__.__name__, self.msg, self.code)
       
    22 
       
    23 class ConfigError(VMMError):
       
    24     """Exception class for configuration exceptions"""
       
    25     pass
       
    26 
       
    27 
       
    28 class PermissionError(VMMError):
       
    29     """Exception class for permissions exceptions"""
       
    30     pass
       
    31 
       
    32 
       
    33 class NotRootError(VMMError):
       
    34     """Exception class for non-root exceptions"""
       
    35     pass
       
    36 
       
    37 
       
    38 class DomainError(VMMError):
       
    39     """Exception class for Domain exceptions"""
       
    40     pass
       
    41 
       
    42 
       
    43 class AliasDomainError(VMMError):
       
    44     """Exception class for AliasDomain exceptions"""
       
    45     pass
       
    46 
       
    47 
       
    48 class AccountError(VMMError):
       
    49     """Exception class for Account exceptions"""
       
    50     pass
       
    51 
       
    52 
       
    53 class AliasError(VMMError):
       
    54     """Exception class for Alias exceptions"""
       
    55     pass
       
    56 
       
    57 
       
    58 class EmailAddressError(VMMError):
       
    59     """Exception class for EmailAddress exceptions"""
       
    60     pass
       
    61 
       
    62 
       
    63 class MailLocationError(VMMError):
       
    64     """Exception class for MailLocation exceptions"""
       
    65     pass
       
    66 
       
    67 
       
    68 class RelocatedError(VMMError):
       
    69     """Exception class for Relocated exceptions"""
       
    70     pass
       
    71 
       
    72 
       
    73 class TransportError(VMMError):
       
    74     """Exception class for Transport exceptions"""
       
    75     pass