Raise LdapServerException instead of string
Benjamin Renard

Benjamin Renard commited on 2015-04-01 15:07:49
Showing 1 changed files, with 5 additions and 1 deletions.

... ...
@@ -23,7 +23,7 @@ class LdapServer(object):
23 23
 
24 24
 	def _error(self,error,level=logging.WARNING):
25 25
 		if self.raiseOnError:
26
-			raise 'LdapServer - Error connecting and binding to LDAP server : %s' % e
26
+			raise LdapServerException('LdapServer - Error connecting and binding to LDAP server : %s' % error)
27 27
 		else:
28 28
 			logging.log(level,error)
29 29
 
... ...
@@ -106,3 +106,7 @@ class LdapServer(object):
106 106
 				return obj[attr][0]
107 107
 			else:
108 108
 				return None
109
+
110
+class LdapServerException(BaseException):
111
+	def __init__(self,msg):
112
+		BaseException.__init__(self, msg)
109 113