Raise LdapServerException instead of string
This commit is contained in:
parent
c0495e99b3
commit
0a10f2f984
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue