Commit a9841f10 authored by Sebastien Robin's avatar Sebastien Robin

make sure to not hide errors of searchResult and countResult

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11242 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 24c129ab
...@@ -1801,36 +1801,23 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1801,36 +1801,23 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
""" Builds a complex SQL where_expression to simulate ZCalatog behaviour """ """ Builds a complex SQL where_expression to simulate ZCalatog behaviour """
""" Returns a list of brains from a set of constraints on variables """ """ Returns a list of brains from a set of constraints on variables """
# The used argument is deprecated and is ignored # The used argument is deprecated and is ignored
try: method = getattr(self, self.sql_search_results)
# Get the search method # Return the result
method = getattr(self, self.sql_search_results) kw['used'] = used
# Return the result kw['REQUEST'] = REQUEST
kw['used'] = used return self.queryResults(method, **kw)
kw['REQUEST'] = REQUEST
return self.queryResults(method, **kw)
except ConflictError:
raise
except:
LOG('SQLCatalog', WARNING, "could not search catalog", error=sys.exc_info())
return []
__call__ = searchResults __call__ = searchResults
def countResults(self, REQUEST=None, used=None, **kw): def countResults(self, REQUEST=None, used=None, **kw):
""" Builds a complex SQL where_expression to simulate ZCalatog behaviour """ """ Builds a complex SQL where_expression to simulate ZCalatog behaviour """
""" Returns the number of items which satisfy the where_expression """ """ Returns the number of items which satisfy the where_expression """
try: # Get the search method
# Get the search method method = getattr(self, self.sql_count_results)
method = getattr(self, self.sql_count_results) # Return the result
# Return the result kw['used'] = used
kw['used'] = used kw['REQUEST'] = REQUEST
kw['REQUEST'] = REQUEST return self.queryResults(method, **kw)
return self.queryResults(method, **kw)
except ConflictError:
raise
except:
LOG('SQLCatalog', WARNING, "could not count catalog", error=sys.exc_info())
return [[0]]
def recordObjectList(self, path_list, catalog=1): def recordObjectList(self, path_list, catalog=1):
""" """
......
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