Skip to content
Snippets Groups Projects
Commit d328a93b authored by Erik Johnston's avatar Erik Johnston
Browse files

Fixup error handling and message

parent dc5efc92
No related branches found
No related tags found
No related merge requests found
......@@ -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 = """\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment