[Erp5-report] r11242 - /erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Nov 10 11:09:07 CET 2006


Author: seb
Date: Fri Nov 10 11:09:05 2006
New Revision: 11242

URL: http://svn.erp5.org?rev=11242&view=rev
Log:
make sure to not hide errors of searchResult and countResult

Modified:
    erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

Modified: erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLCatalog.py?rev=11242&r1=11241&r2=11242&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLCatalog.py Fri Nov 10 11:09:05 2006
@@ -1801,36 +1801,23 @@
     """ Builds a complex SQL where_expression to simulate ZCalatog behaviour """
     """ Returns a list of brains from a set of constraints on variables """
     # The used argument is deprecated and is ignored
-    try:
-      # Get the search method
-      method = getattr(self, self.sql_search_results)
-      # Return the result
-      kw['used'] = used
-      kw['REQUEST'] = REQUEST
-      return self.queryResults(method, **kw)
-    except ConflictError:
-      raise
-    except:
-      LOG('SQLCatalog', WARNING, "could not search catalog", error=sys.exc_info())
-      return []
+    method = getattr(self, self.sql_search_results)
+    # Return the result
+    kw['used'] = used
+    kw['REQUEST'] = REQUEST
+    return self.queryResults(method, **kw)
 
   __call__ = searchResults
 
   def countResults(self, REQUEST=None, used=None, **kw):
     """ Builds a complex SQL where_expression to simulate ZCalatog behaviour """
     """ Returns the number of items which satisfy the where_expression """
-    try:
-      # Get the search method
-      method = getattr(self, self.sql_count_results)
-      # Return the result
-      kw['used'] = used
-      kw['REQUEST'] = REQUEST
-      return self.queryResults(method, **kw)
-    except ConflictError:
-      raise
-    except:
-      LOG('SQLCatalog', WARNING, "could not count catalog", error=sys.exc_info())
-      return [[0]]
+    # Get the search method
+    method = getattr(self, self.sql_count_results)
+    # Return the result
+    kw['used'] = used
+    kw['REQUEST'] = REQUEST
+    return self.queryResults(method, **kw)
 
   def recordObjectList(self, path_list, catalog=1):
     """




More information about the Erp5-report mailing list