Nicer error when listen on socket is not found

This commit is contained in:
Kovid Goyal 2022-08-16 10:59:51 +05:30
parent 02d06d6726
commit ca2a121696
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -516,6 +516,8 @@ def main(args: List[str]) -> None:
except KeyboardInterrupt:
sys.excepthook = lambda *a: print('Interrupted by user', file=sys.stderr)
raise
except FileNotFoundError:
raise SystemExit(f'No listen on socket found at: {global_opts.to}')
except SocketClosed as e:
raise SystemExit(str(e))
if no_response: