Prevent crash when sentry could not be initialized

This commit is contained in:
Jaime van Kessel 2020-05-18 11:42:39 +02:00
parent d499c6fdfe
commit 252be6352b
No known key found for this signature in database
GPG Key ID: 3710727397403C91

View File

@ -63,6 +63,7 @@ if with_sentry_sdk:
# Errors to be ignored by Sentry # Errors to be ignored by Sentry
ignore_errors = [KeyboardInterrupt, MemoryError] ignore_errors = [KeyboardInterrupt, MemoryError]
try:
sentry_sdk.init("https://5034bf0054fb4b889f82896326e79b13@sentry.io/1821564", sentry_sdk.init("https://5034bf0054fb4b889f82896326e79b13@sentry.io/1821564",
before_send = CrashHandler.sentryBeforeSend, before_send = CrashHandler.sentryBeforeSend,
environment = sentry_env, environment = sentry_env,
@ -71,6 +72,8 @@ if with_sentry_sdk:
max_breadcrumbs = 300, max_breadcrumbs = 300,
server_name = "cura", server_name = "cura",
ignore_errors = ignore_errors) ignore_errors = ignore_errors)
except Exception:
with_sentry_sdk = False
if not known_args["debug"]: if not known_args["debug"]:
def get_cura_dir_path(): def get_cura_dir_path():