summary refs log tree commit diff
path: root/synapse/config/password_auth_providers.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-11-08 17:23:28 +0000
committerErik Johnston <erik@matrix.org>2016-11-08 17:23:28 +0000
commitac507e7ab8eb4dd02c9229d312d1f278a5b041b1 (patch)
treeeb1eb1890d909df2137ec352a62a77471854fd1f /synapse/config/password_auth_providers.py
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-ac507e7ab8eb4dd02c9229d312d1f278a5b041b1.tar.xz
Don't assume providers raise ConfigError's
Diffstat (limited to 'synapse/config/password_auth_providers.py')
-rw-r--r--synapse/config/password_auth_providers.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/config/password_auth_providers.py b/synapse/config/password_auth_providers.py
index f6d9bb1c62..1f438d2bb3 100644
--- a/synapse/config/password_auth_providers.py
+++ b/synapse/config/password_auth_providers.py
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from ._base import Config
+from ._base import Config, ConfigError
 
 import importlib
 
@@ -39,7 +39,12 @@ class PasswordAuthProviderConfig(Config):
             module = importlib.import_module(module)
             provider_class = getattr(module, clz)
 
-            provider_config = provider_class.parse_config(provider["config"])
+            try:
+                provider_config = provider_class.parse_config(provider["config"])
+            except Exception as e:
+                raise ConfigError(
+                    "Failed to parse config for %r: %r" % (provider['module'], e)
+                )
             self.password_providers.append((provider_class, provider_config))
 
     def default_config(self, **kwargs):