Skip to content
Snippets Groups Projects
Commit 2129dd1a authored by Richard van der Hoff's avatar Richard van der Hoff
Browse files

Fail cleanly if listener config lacks a 'port'

... otherwise we would fail with a mysterious KeyError or something later.
parent 5d27730a
No related branches found
No related tags found
No related merge requests found
Fail cleanly if listener config lacks a 'port'
......@@ -129,6 +129,11 @@ class ServerConfig(Config):
self.listeners = config.get("listeners", [])
for listener in self.listeners:
if not isinstance(listener.get("port", None), int):
raise ConfigError(
"Listener configuration is lacking a valid 'port' option"
)
bind_address = listener.pop("bind_address", None)
bind_addresses = listener.setdefault("bind_addresses", [])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment