_exceptions.py
branchstable
changeset 5032 e3fa27fc0d9a
parent 4911 898c35be5873
child 5223 6abd6e3599f4
child 5273 c4caef6f09c9
equal deleted inserted replaced
5031:60c4dea96afa 5032:e3fa27fc0d9a
    43 
    43 
    44 # repository exceptions #######################################################
    44 # repository exceptions #######################################################
    45 
    45 
    46 class ConnectionError(RepositoryError):
    46 class ConnectionError(RepositoryError):
    47     """raised when a bad connection id is given or when an attempt to establish
    47     """raised when a bad connection id is given or when an attempt to establish
    48     a connection failed"""
    48     a connection failed
       
    49     """
    49 
    50 
    50 class AuthenticationError(ConnectionError):
    51 class AuthenticationError(ConnectionError):
    51     """raised when a bad connection id is given or when an attempt to establish
    52     """raised when when an attempt to establish a connection failed do to wrong
    52     a connection failed
    53     connection information (login / password or other authentication token)
    53     """
    54     """
    54     def __init__(self, *args, **kwargs):
    55     def __init__(self, *args, **kwargs):
    55         super(AuthenticationError, self).__init__(*args)
    56         super(AuthenticationError, self).__init__(*args)
    56         self.__dict__.update(kwargs)
    57         self.__dict__.update(kwargs)
    57 
    58 
    58 class BadConnectionId(ConnectionError):
    59 class BadConnectionId(ConnectionError):
    59     """raised when a bad connection id is given or when an attempt to establish
    60     """raised when a bad connection id is given"""
    60     a connection failed"""
       
    61 
       
    62 BadSessionId = BadConnectionId # XXX bw compat for pyro connections
       
    63 
    61 
    64 class UnknownEid(RepositoryError):
    62 class UnknownEid(RepositoryError):
    65     """the eid is not defined in the system tables"""
    63     """the eid is not defined in the system tables"""
    66     msg = 'No entity with eid %s in the repository'
    64     msg = 'No entity with eid %s in the repository'
    67 
    65