QtWebEngine: Don't raise CommandError with no hint

This commit is contained in:
Florian Bruhin 2016-08-18 17:46:12 +02:00
parent 0b9aec873f
commit 2a0e503644

View File

@ -567,7 +567,8 @@ class HintManager(QObject):
filterfunc = webelem.FILTERS.get(self._context.group, lambda e: True)
elems = [e for e in elems if filterfunc(e)]
if not elems:
raise cmdexc.CommandError("No elements found.")
message.error(self._win_id, "No elements found.", immediately=True)
return
strings = self._hint_strings(elems)
log.hints.debug("hints: {}".format(', '.join(strings)))