From ef2d145975f696adc0386e01d2a6680592b3fe5e Mon Sep 17 00:00:00 2001 From: Ivan Tyagov <ivan@nexedi.com> Date: Tue, 15 May 2007 14:35:01 +0000 Subject: [PATCH] Catch all possible exception. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14499 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../portal_skins/erp5_dms/Base_showFoundText.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml index 4a059ca718..85e2878bb9 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_showFoundText.xml @@ -85,12 +85,15 @@ trail = 5\n # maximum lines to show\n maxlines = 5\n \n +# try to convert object to text\n try:\n - txt = context.asText() or \'\'\n -except AttributeError:\n + txt = context.asText()\n +except:\n txt = \'\'\n \n -argument_names = (\'advanced_search_text\', \'title\', \'reference\', \'SearchableText\', \'SearchableText_any\', \'SearchableText_all\', \'SearchableText_phrase\')\n +argument_names = (\'advanced_search_text\', \'title\', \'reference\', \\\n + \'SearchableText\', \'SearchableText_any\', \\\n + \'SearchableText_all\', \'SearchableText_phrase\')\n \n # a quick hack because sometimes we get a list\n params = [selection.params.get(name, \'\') for name in argument_names]\n @@ -171,7 +174,6 @@ return \' \'.join(map(str, res))\n <string>_getattr_</string> <string>context</string> <string>txt</string> - <string>AttributeError</string> <string>argument_names</string> <string>append</string> <string>$append0</string> -- 2.30.9