From 0a10f2f984a15123bd063c95800b036574957004 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 1 Apr 2015 17:07:49 +0200 Subject: [PATCH] Raise LdapServerException instead of string --- LdapServer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LdapServer.py b/LdapServer.py index 81258f9..4c4c9e5 100644 --- a/LdapServer.py +++ b/LdapServer.py @@ -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)