chore(linux): Don't report KeyboardInterrupt to Sentry

When the user presses Ctrl-C we don't want to create a Sentry
issue. This change ignores that exception.
This commit is contained in:
Eberhard Beilharz 2023-01-13 18:27:25 +01:00
parent a27f98d974
commit 5ee9c2ead1
No known key found for this signature in database
GPG key ID: E9140597606020D3

View file

@ -37,6 +37,15 @@ def secure_lookup(data, key1, key2 = None):
return None
def before_send(event, hint):
if 'exc_info' in hint:
exc_type, exc_value, tb = hint['exc_info']
if isinstance(exc_value, KeyboardInterrupt):
# Ignore KeyboardInterrupt exception
return None
return event
gettext.bindtextdomain('keyman-config', '/usr/share/locale')
gettext.textdomain('keyman-config')
@ -77,6 +86,7 @@ else:
environment=__environment__,
release='release-' + __versionwithtag__,
integrations=[sentry_logging],
before_send=before_send
)
set_user({'id': hash(getpass.getuser())})
with configure_scope() as scope: