Use a dedicated exception for rc_cmd.fatal()

This commit is contained in:
Kovid Goyal 2020-03-17 11:40:42 +05:30
parent a49bd98ec6
commit a06fdad034
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -28,6 +28,10 @@ class NoResponse:
pass
class RemoteControlError(Exception):
pass
class MatchError(ValueError):
hide_traceback = True
@ -115,7 +119,7 @@ class RemoteCommand:
def fatal(self, msg: str) -> NoReturn:
if running_in_kitty():
raise Exception(msg)
raise RemoteControlError(msg)
raise SystemExit(msg)
def get_default(self, name: str, missing: Any = None) -> Any: