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

Commit

Permalink
Merge pull request #1619 from matrix-org/erikj/pwd_provider_error
Browse files Browse the repository at this point in the history
Don't assume providers raise ConfigError's
  • Loading branch information
erikjohnston committed Nov 9, 2016
2 parents e6651e8 + ac507e7 commit 6cc4fcf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions synapse/config/password_auth_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -39,7 +39,12 @@ def read_config(self, 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):
Expand Down

0 comments on commit 6cc4fcf

Please sign in to comment.