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 ...@@ -85,12 +85,15 @@ trail = 5\n
# maximum lines to show\n # maximum lines to show\n
maxlines = 5\n maxlines = 5\n
\n \n
# try to convert object to text\n
try:\n try:\n
txt = context.asText() or \'\'\n txt = context.asText()\n
except AttributeError:\n except:\n
txt = \'\'\n txt = \'\'\n
\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 \n
# a quick hack because sometimes we get a list\n # a quick hack because sometimes we get a list\n
params = [selection.params.get(name, \'\') for name in argument_names]\n params = [selection.params.get(name, \'\') for name in argument_names]\n
...@@ -171,7 +174,6 @@ return \' \'.join(map(str, res))\n ...@@ -171,7 +174,6 @@ return \' \'.join(map(str, res))\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>txt</string> <string>txt</string>
<string>AttributeError</string>
<string>argument_names</string> <string>argument_names</string>
<string>append</string> <string>append</string>
<string>$append0</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