summary refs log tree commit diff
path: root/synapse/app/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-10-02 17:59:34 +0100
committerErik Johnston <erik@matrix.org>2017-10-02 17:59:34 +0100
commit3fed5bb25f92586a6467494d4673627abcd25665 (patch)
tree8ca49d3b264d0b7ebf7eab1284ec02d6e4e2aff6 /synapse/app/_base.py
parentMerge branch 'release-v0.23.0' of github.com:matrix-org/synapse (diff)
downloadsynapse-3fed5bb25f92586a6467494d4673627abcd25665.tar.xz
Move quit_with_error
Diffstat (limited to 'synapse/app/_base.py')
-rw-r--r--synapse/app/_base.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py
index cd0e815919..e1ff8f9b7c 100644
--- a/synapse/app/_base.py
+++ b/synapse/app/_base.py
@@ -97,3 +97,13 @@ def start_reactor(
         daemon.start()
     else:
         run()
+
+
+def quit_with_error(error_string):
+    message_lines = error_string.split("\n")
+    line_length = max([len(l) for l in message_lines if len(l) < 80]) + 2
+    sys.stderr.write("*" * line_length + '\n')
+    for line in message_lines:
+        sys.stderr.write(" %s\n" % (line.rstrip(),))
+    sys.stderr.write("*" * line_length + '\n')
+    sys.exit(1)