From 9bd86ae8a8b5a7078eed7a07c6d31abf41b57b37 Mon Sep 17 00:00:00 2001 From: Chris Harding Date: Mon, 15 Jan 2024 00:01:44 -0500 Subject: [PATCH] __init__.py: Add server.listen error message If the protocol is not specified/wrong the error message is quite cryptic --- isso/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/isso/__init__.py b/isso/__init__.py index be441be0b..68468de73 100644 --- a/isso/__init__.py +++ b/isso/__init__.py @@ -295,7 +295,7 @@ def main(): except ImportError: run_simple(host, port, make_app(conf), threaded=True, use_reloader=conf.getboolean('server', 'reload')) - else: + elif conf.get("server", "listen").startswith("unix://"): sock = conf.get("server", "listen").partition("unix://")[2] try: os.unlink(sock) @@ -303,3 +303,6 @@ def main(): if ex.errno != errno.ENOENT: raise wsgi.SocketHTTPServer(sock, make_app(conf)).serve_forever() + else: + logger.error("server.listen must specify a protocol of http:// or unix://") + sys.exit(1)