Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit e15aa00

Browse files
authored
Fix error message when app_service_config_files validation fails (#15614)
The second argument of `ConfigError` is a path, passed as an optional `Iterable[str]` and not a `str`. If a string is passed directly, Synapse unhelpfully emits "Error in configuration at a.p.p._.s.e.r.v.i.c.e._.c.o.n.f.i.g._.f.i.l.e.s'" when the config option has the wrong data type. Signed-off-by: Sean Quah <[email protected]>
1 parent 41b9def commit e15aa00

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

changelog.d/15614.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug introduced in Synapse 1.82.0 where the error message displayed when validation of the `app_service_config_files` config option fails would be incorrectly formatted.

synapse/config/appservice.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
3636
if not isinstance(self.app_service_config_files, list) or not all(
3737
type(x) is str for x in self.app_service_config_files
3838
):
39-
# type-ignore: this function gets arbitrary json value; we do use this path.
4039
raise ConfigError(
4140
"Expected '%s' to be a list of AS config files:"
4241
% (self.app_service_config_files),
43-
"app_service_config_files",
42+
("app_service_config_files",),
4443
)
4544

4645
self.track_appservice_user_ips = config.get("track_appservice_user_ips", False)

0 commit comments

Comments
 (0)