Catch userscript exception and show error message

This commit is contained in:
Artur Shaikhullin 2017-12-28 20:40:37 +06:00
parent 9728e90401
commit 63658d3a1e

View File

@ -1247,7 +1247,10 @@ class CommandDispatcher:
self.openurl(config.val.url.start_pages[0]) self.openurl(config.val.url.start_pages[0])
def _selection_callback(self, s): def _selection_callback(self, s):
try:
self._run_userscript(s) self._run_userscript(s)
except cmdexc.CommandError as e:
message.error(str(e))
def _run_userscript(self, selection): def _run_userscript(self, selection):
"""Run a userscript given as argument. """Run a userscript given as argument.