Skip to content

Commit

Permalink
Don't assume providers raise ConfigError's
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Nov 8, 2016
1 parent e6651e8 commit ac507e7
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 ac507e7

Please sign in to comment.