diff options
author | Erik Johnston <erik@matrix.org> | 2019-02-18 16:53:56 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-02-18 16:53:56 +0000 |
commit | d328a93b51d22039e361178a5fcf952d9735cd3f (patch) | |
tree | 530cc87e99d41c7a684ad15aa7d56fbba617b000 /synapse/config | |
parent | Fixup (diff) | |
download | synapse-d328a93b51d22039e361178a5fcf952d9735cd3f.tar.xz |
Fixup error handling and message
Diffstat (limited to 'synapse/config')
-rw-r--r-- | synapse/config/metrics.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/config/metrics.py b/synapse/config/metrics.py index fc72e32d20..35f1074765 100644 --- a/synapse/config/metrics.py +++ b/synapse/config/metrics.py @@ -16,11 +16,8 @@ from ._base import Config, ConfigError MISSING_SENTRY = ( - """Missing sentry_sdk library. This is required to enable sentry + """Missing sentry-sdk library. This is required to enable sentry integration. - - Install by running: - pip install sentry_sdk """ ) @@ -39,7 +36,11 @@ class MetricsConfig(Config): except ImportError: raise ConfigError(MISSING_SENTRY) - self.sentry_dsn = config["sentry"]["dsn"] + self.sentry_dsn = config["sentry"].get("dsn") + if not self.sentry_dsn: + raise ConfigError( + "sentry.dsn field is required when sentry integration is enabled", + ) def default_config(self, report_stats=None, **kwargs): res = """\ |