mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-09-15 22:51:54 +00:00
Fixup error handling and message
This commit is contained in:
parent
dc5efc92a8
commit
d328a93b51
@ -16,11 +16,8 @@
|
|||||||
from ._base import Config, ConfigError
|
from ._base import Config, ConfigError
|
||||||
|
|
||||||
MISSING_SENTRY = (
|
MISSING_SENTRY = (
|
||||||
"""Missing sentry_sdk library. This is required to enable sentry
|
"""Missing sentry-sdk library. This is required to enable sentry
|
||||||
integration.
|
integration.
|
||||||
|
|
||||||
Install by running:
|
|
||||||
pip install sentry_sdk
|
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -39,7 +36,11 @@ class MetricsConfig(Config):
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
raise ConfigError(MISSING_SENTRY)
|
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):
|
def default_config(self, report_stats=None, **kwargs):
|
||||||
res = """\
|
res = """\
|
||||||
|
Loading…
Reference in New Issue
Block a user