diff options
author | Erik Johnston <erik@matrix.org> | 2016-02-10 14:52:06 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-02-10 14:52:06 +0000 |
commit | 907c1faf1e4655659d9a9db1615e911640b9f383 (patch) | |
tree | e9f18d4f3044cab76ab5ae119505ea651194db5e /synapse/config/__main__.py | |
parent | Merge pull request #476 from koobs/patch-1 (diff) | |
parent | Update CHANGES (diff) | |
download | synapse-907c1faf1e4655659d9a9db1615e911640b9f383.tar.xz |
Merge branch 'release-v0.13.0' of github.com:matrix-org/synapse v0.13.0
Diffstat (limited to 'synapse/config/__main__.py')
-rw-r--r-- | synapse/config/__main__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/config/__main__.py b/synapse/config/__main__.py index f822d12036..0a3b70e11f 100644 --- a/synapse/config/__main__.py +++ b/synapse/config/__main__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2015 OpenMarket Ltd +# Copyright 2015, 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +from synapse.config._base import ConfigError if __name__ == "__main__": import sys @@ -21,7 +22,11 @@ if __name__ == "__main__": if action == "read": key = sys.argv[2] - config = HomeServerConfig.load_config("", sys.argv[3:]) + try: + config = HomeServerConfig.load_config("", sys.argv[3:]) + except ConfigError as e: + sys.stderr.write("\n" + e.message + "\n") + sys.exit(1) print getattr(config, key) sys.exit(0) |