server/sources/ldapuser.py
branchstable
changeset 6693 65bd93b72f1e
parent 6653 52d1568af412
child 6724 24bf6f181d0e
child 6750 ef513c03a224
--- a/server/sources/ldapuser.py	Fri Nov 05 18:48:07 2010 +0100
+++ b/server/sources/ldapuser.py	Fri Nov 12 13:47:26 2010 +0100
@@ -369,8 +369,14 @@
         try:
             results = self._query_cache[rqlkey]
         except KeyError:
-            results = self.rqlst_search(session, rqlst, args)
-            self._query_cache[rqlkey] = results
+            try:
+                results = self.rqlst_search(session, rqlst, args)
+                self._query_cache[rqlkey] = results
+            except ldap.SERVER_DOWN:
+                # cant connect to server
+                msg = session._("can't connect to source %s, some data may be missing")
+                session.set_shared_data('sources_error', msg % self.uri)
+                return []
         return results
 
     def rqlst_search(self, session, rqlst, args):