summary refs log tree commit diff
path: root/synapse/app/homeserver.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-12-16 17:29:49 +0000
committerMark Haines <mark.haines@matrix.org>2014-12-16 17:29:49 +0000
commit56db465047c2906a78eccdd63b2fa18d72903a66 (patch)
treebdd082c04fd0c02b4d732bf8ea6e4dd559d84b51 /synapse/app/homeserver.py
parentSYN-142: Use a default log file 'homeserver.log' so people get logging by def... (diff)
parentChange upgrade script to not check hashes or signatures (diff)
downloadsynapse-56db465047c2906a78eccdd63b2fa18d72903a66.tar.xz
Merge branch 'release-v0.6.0' into develop
Diffstat (limited to 'synapse/app/homeserver.py')
-rwxr-xr-xsynapse/app/homeserver.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index a6e29c0860..140c99f18a 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from synapse.storage import prepare_database
+from synapse.storage import prepare_database, UpgradeDatabaseException
 
 from synapse.server import HomeServer
 
@@ -228,8 +228,15 @@ def setup():
 
     logger.info("Preparing database: %s...", db_name)
 
-    with sqlite3.connect(db_name) as db_conn:
-        prepare_database(db_conn)
+    try:
+        with sqlite3.connect(db_name) as db_conn:
+            prepare_database(db_conn)
+    except UpgradeDatabaseException:
+        sys.stderr.write(
+            "\nFailed to upgrade database.\n"
+            "Have you followed any instructions in UPGRADES.rst?\n"
+        )
+        sys.exit(1)
 
     logger.info("Database prepared in %s.", db_name)