Commit dba31739 authored by Nicolas Delaby's avatar Nicolas Delaby

Replace String Exception by Exception instances

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30537 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6d2cb41f
# -*- coding: utf-8 -*-
# core of LDAP Filter Methods.
......@@ -180,6 +181,9 @@ _ldapScopes = { "ONELEVEL": ldap.SCOPE_ONELEVEL,
"SUBTREE": ldap.SCOPE_SUBTREE,
"BASE": ldap.SCOPE_BASE }
class LDAPError(Exception):
pass
class LDAPMethod(Aqueduct.BaseQuery,
Acquisition.Implicit,
Globals.Persistent,
......@@ -319,7 +323,7 @@ class LDAPMethod(Aqueduct.BaseQuery,
else: REQUEST={}
c = self._getConn()
if not c:
raise "LDAPError", "LDAP Connection not open"
raise LDAPError('LDAP Connection not open')
if getattr(self, 'aq_parent', None) is not None:
p = self.aq_parent
......@@ -452,7 +456,7 @@ class LDIFMethod(LDAPMethod):
else: REQUEST={}
c = self._connection().GetConnection()
if not c:
raise "LDAPError", "LDAP Connection not open"
raise LDAPError('LDAP Connection not open')
if hasattr(self, 'aq_parent'):
p = self.aq_parent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment