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

Commit dcbfec9

Browse files
authored
Improve the error message printed by synctl when synapse fails to start. (#10059)
1 parent 5447a76 commit dcbfec9

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

changelog.d/10059.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve the error message printed by synctl when synapse fails to start.

synctl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,15 @@ def start(pidfile: str, app: str, config_files: Iterable[str], daemonize: bool)
9797
write("started %s(%s)" % (app, ",".join(config_files)), colour=GREEN)
9898
return True
9999
except subprocess.CalledProcessError as e:
100-
write(
101-
"error starting %s(%s) (exit code: %d); see above for logs"
102-
% (app, ",".join(config_files), e.returncode),
103-
colour=RED,
100+
err = "%s(%s) failed to start (exit code: %d). Check the Synapse logfile" % (
101+
app,
102+
",".join(config_files),
103+
e.returncode,
104104
)
105+
if daemonize:
106+
err += ", or run synctl with --no-daemonize"
107+
err += "."
108+
write(err, colour=RED, stream=sys.stderr)
105109
return False
106110

107111

0 commit comments

Comments
 (0)