[Erp5-report] r41935 kazuhiko - in /erp5/trunk/bt5/erp5_full_text_sphinxse_catalog: Catalog...
nobody at svn.erp5.org
nobody at svn.erp5.org
Sun Jan 2 23:25:44 CET 2011
Author: kazuhiko
Date: Sun Jan 2 23:25:43 2011
New Revision: 41935
URL: http://svn.erp5.org?rev=41935&view=rev
Log:
catch any exception (except ConflictError).
Modified:
erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_catalogSphinxSE.xml
erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision
Modified: erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_catalogSphinxSE.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_catalogSphinxSE.xml?rev=41935&r1=41934&r2=41935&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_catalogSphinxSE.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_catalogSphinxSE.xml [utf8] Sun Jan 2 23:25:43 2011
@@ -51,7 +51,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Utils import UpperCase\n
-from Products.ERP5.Document.Document import NotConvertedError\n
+from ZODB.POSException import ConflictError\n
\n
# Obtain the properties from the Z SQL Method itself, as like catalogObjectList.\n
method = context.z_catalog_sphinxse_index_list\n
@@ -67,18 +67,21 @@ for path in getPath:\n
if obj is None:\n
continue\n
\n
- for property in property_list:\n
- if property == \'SearchableText\':\n
- try:\n
+ try:\n
+ tmp_dict = {}\n
+ for property in property_list:\n
+ if property == \'SearchableText\':\n
value = obj.SearchableText()\n
- except NotConvertedError:\n
- failed_path_list.append(path)\n
- else:\n
- try:\n
+ else:\n
value = getattr(obj, \'get%s\' % UpperCase(property))()\n
- except AttributeError:\n
- value = None\n
- parameter_dict.setdefault(property, []).append(value)\n
+ tmp_dict[property] = value\n
+ except ConflictError:\n
+ raise\n
+ except:\n
+ failed_path_list.append(path)\n
+ else:\n
+ for property, value in tmp_dict.items():\n
+ parameter_dict.setdefault(property, []).append(value)\n
\n
if len(failed_path_list):\n
if len(parameter_dict):\n
@@ -86,7 +89,7 @@ if len(failed_path_list):\n
context.activate(activity=\'SQLQueue\', priority=5, serialization_tag=\'sphinxse_indexing\').SQLCatalog_catalogSphinxSE(getPath=failed_path_list)\n
else:\n
# if all objects are failed one, just raise an exception to avoid infinite loop.\n
- raise NotConvertedError\n
+ raise AttributeError, \'exception raised in indexing %r\' % failed_path_list\n
\n
if len(parameter_dict):\n
return method(**parameter_dict)\n
Modified: erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision?rev=41935&r1=41934&r2=41935&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_full_text_sphinxse_catalog/bt/revision [utf8] Sun Jan 2 23:25:43 2011
@@ -1 +1 @@
-9
\ No newline at end of file
+11
\ No newline at end of file
More information about the Erp5-report
mailing list