common base for userscript exceptions
This commit is contained in:
parent
cbbfbabfc4
commit
eaa754648d
@ -1122,7 +1122,7 @@ class CommandDispatcher:
|
||||
try:
|
||||
userscripts.run_async(tab, cmd, *args, win_id=self._win_id,
|
||||
env=env, verbose=verbose)
|
||||
except (userscripts.UnsupportedError, userscripts.NotFoundError) as e:
|
||||
except userscripts.Error as e:
|
||||
raise cmdexc.CommandError(e)
|
||||
|
||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||
|
@ -315,7 +315,12 @@ class _WindowsUserscriptRunner(_BaseUserscriptRunner):
|
||||
return
|
||||
|
||||
|
||||
class NotFoundError(Exception):
|
||||
class Error(Exception):
|
||||
|
||||
"""Base class for userscript exceptions."""
|
||||
|
||||
|
||||
class NotFoundError(Error):
|
||||
|
||||
"""Raised when spawning a userscript that doesn't exist.
|
||||
|
||||
@ -338,7 +343,7 @@ class NotFoundError(Exception):
|
||||
return self.message
|
||||
|
||||
|
||||
class UnsupportedError(Exception):
|
||||
class UnsupportedError(Error):
|
||||
|
||||
"""Raised when userscripts aren't supported on this platform."""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user