mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-16 23:11:34 +01:00
Catch exceptions in password_providers (#8636)
Signed-off-by: Nicolai Søborg <git@xn--sb-lka.org>
This commit is contained in:
parent
c059413001
commit
4c7587ef99
2 changed files with 10 additions and 4 deletions
1
changelog.d/8636.misc
Normal file
1
changelog.d/8636.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Catch exceptions during initialization of `password_providers`. Contributed by Nicolai Søborg.
|
|
@ -181,10 +181,15 @@ class AuthHandler(BaseHandler):
|
|||
# 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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue