Source code for laurelin.ldap.exceptions
[docs]class LDAPError(Exception):
"""Base class for all exceptions raised by laurelin"""
pass
[docs]class Abandon(Exception):
"""Can be raised to cleanly exit a context manager and abandon unread results"""
pass
[docs]class LDAPWarning(Warning):
"""Generic LDAP warning category"""
pass
[docs]class LDAPUnicodeWarning(LDAPWarning, UnicodeWarning):
"""Warning category for unicode issues relating to LDAP"""
pass
[docs]class LDAPUnsolicitedMessage(Exception):
"""Raised when a message with ID 0 is returned from the server
This may indicate an incompatability between laurelin and your server distribution and thus is outside the normal
exception inheritance chain.
"""
def __init__(self, lm, exc_msg):
self.ldap_message = lm
Exception.__init__(self, exc_msg)
[docs]class LDAPExtensionError(LDAPError):
"""Error occurred setting up an extension module"""
pass
[docs]class LDAPSupportError(LDAPError):
"""A feature is not supported by the server"""
pass
[docs]class LDAPSASLError(LDAPError):
"""Error occurred involving the SASL client"""
pass
[docs]class LDAPConnectionError(LDAPError):
"""Error occurred creating connection to the LDAP server"""
pass
[docs]class TagError(LDAPError):
"""Error with an object tag"""
pass
[docs]class UnexpectedResponseType(LDAPError):
"""The response did not contain the expected protocol operation"""
pass
[docs]class UnexpectedSearchResults(LDAPError):
"""Base class for unhandled search result situations"""
pass
[docs]class NoSearchResults(UnexpectedSearchResults):
"""Got no search results when one or more was required"""
pass
[docs]class MultipleSearchResults(UnexpectedSearchResults):
"""Got multiple search results when exactly one was required"""
pass
[docs]class InvalidBindState(LDAPError):
"""Base class for exceptions related to bind state"""
pass
[docs]class ConnectionAlreadyBound(InvalidBindState):
"""Only raised by LDAP.*Bind methods if the connection is already bound when called"""
def __init__(self):
LDAPError.__init__(self, 'The connection has already been bound')
[docs]class ConnectionUnbound(InvalidBindState):
"""Raised when any server operation is attempted after a connection is unbound/closed"""
def __init__(self):
LDAPError.__init__(self, 'The connection has been unbound')
[docs]class ProhibitedCharacterError(LDAPError):
"""Raised when a prohibited character is detected in RFC4518 string prep"""
pass
[docs]class LDAPSchemaError(LDAPError):
"""Error relating to setting up the LDAP schema"""
pass
[docs]class LDAPValidationError(LDAPError):
"""Raised when validation fails"""
pass
[docs]class InvalidSyntaxError(LDAPValidationError):
"""Raised when syntax validation fails"""
pass
[docs]class LDAPTransactionError(LDAPError):
"""Raised by actions not included in a modify transaction"""
pass