mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 18:12:21 +02:00
[fix] NotImplementedError raised by ResultContainer (#5058)
If the ``on_result`` handle returns False, then the ``else`` was always jumped to, which throws the NotImplementedError exception:: File "/usr/local/searxng/searxng-src/searx/results.py", line 99, in extend raise NotImplementedError(f"no handler implemented to process the result of type {result}") NotImplementedError: no handler implemented to process the result of type MainResult(title=...
This commit is contained in:
parent
8084a86784
commit
17f2027c4f
1 changed files with 4 additions and 2 deletions
|
@ -88,10 +88,12 @@ class ResultContainer:
|
|||
if isinstance(result, Result):
|
||||
result.engine = result.engine or engine_name
|
||||
result.normalize_result_fields()
|
||||
if not self.on_result(result):
|
||||
continue
|
||||
|
||||
if isinstance(result, BaseAnswer) and self.on_result(result):
|
||||
if isinstance(result, BaseAnswer):
|
||||
self.answers.add(result)
|
||||
elif isinstance(result, MainResult) and self.on_result(result):
|
||||
elif isinstance(result, MainResult):
|
||||
main_count += 1
|
||||
self._merge_main_result(result, main_count)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue