mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-10 12:02:43 +01:00
Fail cleanly if listener config lacks a 'port'
... otherwise we would fail with a mysterious KeyError or something later.
This commit is contained in:
parent
5d27730a73
commit
2129dd1a02
2 changed files with 6 additions and 0 deletions
1
changelog.d/4616.misc
Normal file
1
changelog.d/4616.misc
Normal file
|
@ -0,0 +1 @@
|
|||
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", [])
|
||||
|
||||
|
|
Loading…
Reference in a new issue