mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-07 22:47:29 +00:00
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:
parent
a27f98d974
commit
5ee9c2ead1
1 changed files with 10 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue