Raise LdapServerException instead of string

This commit is contained in:
Benjamin Renard 2015-04-01 17:07:49 +02:00
parent c0495e99b3
commit 0a10f2f984

View file

@ -23,7 +23,7 @@ class LdapServer(object):
def _error(self,error,level=logging.WARNING):
if self.raiseOnError:
raise 'LdapServer - Error connecting and binding to LDAP server : %s' % e
raise LdapServerException('LdapServer - Error connecting and binding to LDAP server : %s' % error)
else:
logging.log(level,error)
@ -106,3 +106,7 @@ class LdapServer(object):
return obj[attr][0]
else:
return None
class LdapServerException(BaseException):
def __init__(self,msg):
BaseException.__init__(self, msg)