Commit ef2d1459 authored by Ivan Tyagov's avatar Ivan Tyagov

Catch all possible exception.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14499 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9442812b
......@@ -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>
......
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