Skip to content

Commit

Permalink
Merge pull request #981 from sjrct/listen-proto-error-msg
Browse files Browse the repository at this point in the history
Add error message for improperly configured server.listen
  • Loading branch information
ix5 authored Jan 22, 2024
2 parents c9b1a1c + 9bd86ae commit 1429ed1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion isso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,14 @@ 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)
except OSError as ex:
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)

0 comments on commit 1429ed1

Please sign in to comment.