Fix error display when remote control mapping fails

This commit is contained in:
Kovid Goyal 2023-03-01 17:45:57 +05:30
parent 004aaf3291
commit bd32019b91
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -701,10 +701,9 @@ class Boss:
def remote_control(self, *args: str) -> None: def remote_control(self, *args: str) -> None:
try: try:
self.call_remote_control(self.active_window, args) self.call_remote_control(self.active_window, args)
except (Exception, SystemExit): except (Exception, SystemExit) as e:
import traceback import shlex
tb = traceback.format_exc() self.show_error(_('remote_control mapping failed'), shlex.join(args) + '\n' + str(e))
self.show_error(_('remote_control mapping failed'), tb)
def call_remote_control(self, active_window: Optional[Window], args: Tuple[str, ...]) -> 'ResponseType': def call_remote_control(self, active_window: Optional[Window], args: Tuple[str, ...]) -> 'ResponseType':
from .rc.base import PayloadGetter, command_for_name, parse_subcommand_cli from .rc.base import PayloadGetter, command_for_name, parse_subcommand_cli