Catch urllib3 exceptions when sending crash report. Ref https://github.com/GNS3/gns3-gui/issues/3483

pull/2258/head
grossmj 10 months ago
parent c5c4e1ad56
commit c226b2a9ef

@ -29,6 +29,7 @@ import struct
import platform
import locale
import distro
import urllib3
from .version import __version__, __version_info__
from .config import Config
@ -82,11 +83,15 @@ class CrashReport:
# Don't send log records as events.
sentry_logging = LoggingIntegration(level=logging.INFO, event_level=None)
sentry_sdk.init(dsn=CrashReport.DSN,
release=__version__,
ca_certs=cacert,
default_integrations=False,
integrations=[sentry_logging])
try:
sentry_sdk.init(dsn=CrashReport.DSN,
release=__version__,
ca_certs=cacert,
default_integrations=False,
integrations=[sentry_logging])
except urllib3.exceptions.HTTPError as e:
log.error("Crash report could not be sent: {}".format(e))
return
tags = {
"os:name": platform.system(),

Loading…
Cancel
Save