mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-18 06:44:19 -05:00
Don't assume providers raise ConfigError's
This commit is contained in:
parent
e6651e8046
commit
ac507e7ab8
@ -13,7 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ._base import Config
|
from ._base import Config, ConfigError
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
@ -39,7 +39,12 @@ class PasswordAuthProviderConfig(Config):
|
|||||||
module = importlib.import_module(module)
|
module = importlib.import_module(module)
|
||||||
provider_class = getattr(module, clz)
|
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))
|
self.password_providers.append((provider_class, provider_config))
|
||||||
|
|
||||||
def default_config(self, **kwargs):
|
def default_config(self, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user