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

Commit

Permalink
Improve the error message printed by synctl when synapse fails to sta…
Browse files Browse the repository at this point in the history
…rt. (#10059)
  • Loading branch information
richvdh committed May 27, 2021
1 parent 5447a76 commit dcbfec9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/10059.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve the error message printed by synctl when synapse fails to start.
12 changes: 8 additions & 4 deletions synctl
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,15 @@ def start(pidfile: str, app: str, config_files: Iterable[str], daemonize: bool)
write("started %s(%s)" % (app, ",".join(config_files)), colour=GREEN)
return True
except subprocess.CalledProcessError as e:
write(
"error starting %s(%s) (exit code: %d); see above for logs"
% (app, ",".join(config_files), e.returncode),
colour=RED,
err = "%s(%s) failed to start (exit code: %d). Check the Synapse logfile" % (
app,
",".join(config_files),
e.returncode,
)
if daemonize:
err += ", or run synctl with --no-daemonize"
err += "."
write(err, colour=RED, stream=sys.stderr)
return False


Expand Down

0 comments on commit dcbfec9

Please sign in to comment.