diff options
author | Alexandre Flament <alex@al-f.net> | 2020-12-17 09:57:57 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-12-20 09:46:53 +0100 |
commit | 3f8ebf70b193f4391a01d7412324a10e4faa56a2 (patch) | |
tree | d65eb74cbe46be6813afdf9907de5941cbbb9a4d /searx/engines | |
parent | eb33ae6893ef9d5081b1ddd1119e7047642a40af (diff) | |
download | searxng-3f8ebf70b193f4391a01d7412324a10e4faa56a2.tar.gz searxng-3f8ebf70b193f4391a01d7412324a10e4faa56a2.zip |
[fix] pylint: use "raise ... from ..."
Diffstat (limited to 'searx/engines')
-rw-r--r-- | searx/engines/elasticsearch.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/searx/engines/elasticsearch.py b/searx/engines/elasticsearch.py index 081736c1c..0e2d35756 100644 --- a/searx/engines/elasticsearch.py +++ b/searx/engines/elasticsearch.py @@ -46,8 +46,8 @@ def _match_query(query): try: key, value = query.split(':') - except: - raise ValueError('query format must be "key:value"') + except Exception as e: + raise ValueError('query format must be "key:value"') from e return {"query": {"match": {key: {'query': value}}}} @@ -71,8 +71,8 @@ def _term_query(query): try: key, value = query.split(':') - except: - raise ValueError('query format must be key:value') + except Exception as e: + raise ValueError('query format must be key:value') from e return {'query': {'term': {key: value}}} @@ -86,8 +86,8 @@ def _terms_query(query): try: key, values = query.split(':') - except: - raise ValueError('query format must be key:value1,value2') + except Exception as e: + raise ValueError('query format must be key:value1,value2') from e return {'query': {'terms': {key: values.split(',')}}} |