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

Commit

Permalink
Catch exceptions in password_providers (#8636)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolai Søborg <git@xn--sb-lka.org>
  • Loading branch information
NicolaiSoeborg committed Nov 11, 2020
1 parent c059413 commit 4c7587e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/8636.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Catch exceptions during initialization of `password_providers`. Contributed by Nicolai Søborg.
13 changes: 9 additions & 4 deletions synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,15 @@ def __init__(self, hs: "HomeServer"):
# better way to break the loop
account_handler = ModuleApi(hs, self)

self.password_providers = [
module(config=config, account_handler=account_handler)
for module, config in hs.config.password_providers
]
self.password_providers = []
for module, config in hs.config.password_providers:
try:
self.password_providers.append(
module(config=config, account_handler=account_handler)
)
except Exception as e:
logger.error("Error while initializing %r: %s", module, e)
raise

logger.info("Extra password_providers: %r", self.password_providers)

Expand Down

0 comments on commit 4c7587e

Please sign in to comment.