diff options
author | Alexandre Flament <alex@al-f.net> | 2020-11-14 13:24:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-14 13:24:31 +0100 |
commit | 102c08838b4f4afe044d8eafcc0de635f1401d35 (patch) | |
tree | edbb5fb3132f161da8673c90ee8bf715c3a1e204 /searx/webapp.py | |
parent | 46b454277f70cb504a1276286e07048b8a5651bf (diff) | |
parent | 58d72f26925d56e22330c54be03c3dcbee0c4135 (diff) | |
download | searxng-102c08838b4f4afe044d8eafcc0de635f1401d35.tar.gz searxng-102c08838b4f4afe044d8eafcc0de635f1401d35.zip |
Merge pull request #2289 from dalf/pylint
[mod] pylint: add extension-pkg-whitelist=lxml.etree
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-x | searx/webapp.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 9aa80906a..326200cec 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -44,7 +44,7 @@ from urllib.parse import urlencode, urlparse, urljoin, urlsplit from pygments import highlight from pygments.lexers import get_lexer_by_name -from pygments.formatters import HtmlFormatter +from pygments.formatters import HtmlFormatter # pylint: disable=no-name-in-module from werkzeug.middleware.proxy_fix import ProxyFix from flask import ( @@ -111,7 +111,7 @@ app = Flask( app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True -app.jinja_env.add_extension('jinja2.ext.loopcontrols') +app.jinja_env.add_extension('jinja2.ext.loopcontrols') # pylint: disable=no-member app.secret_key = settings['server']['secret_key'] # see https://flask.palletsprojects.com/en/1.1.x/cli/ @@ -589,15 +589,12 @@ def search(): result_container = search.search() + except SearxParameterException as e: + logger.exception('search error: SearxParameterException') + return index_error(output_format, e.message), 400 except Exception as e: - # log exception logger.exception('search error') - - # is it an invalid input parameter or something else ? - if (issubclass(e.__class__, SearxParameterException)): - return index_error(output_format, e.message), 400 - else: - return index_error(output_format, gettext('search error')), 500 + return index_error(output_format, gettext('search error')), 500 # results results = result_container.get_ordered_results() |