openpilot v0.3.7 tweaks

old-commit-hash: 8385b27cad
This commit is contained in:
Vehicle Researcher
2017-10-03 00:22:32 -07:00
parent 90c3815a7f
commit 5ef591d9c2
7 changed files with 42 additions and 6 deletions
-36
View File
@@ -1,36 +0,0 @@
"""Install exception handler for process crash."""
import os
import sys
if os.getenv("NOLOG") or os.getenv("NOCRASH"):
def capture_exception(*exc_info):
pass
def bind_user(**kwargs):
pass
def bind_extra(**kwargs):
pass
def install():
pass
else:
from raven import Client
from raven.transport.http import HTTPTransport
client = Client('https://1994756b5e6f41cf939a4c65de45f4f2:cefebaf3a8aa40d182609785f7189bd7@app.getsentry.com/77924',
install_sys_hook=False, transport=HTTPTransport)
capture_exception = client.captureException
def bind_user(**kwargs):
client.user_context(kwargs)
def bind_extra(**kwargs):
client.extra_context(kwargs)
def install():
# installs a sys.excepthook
__excepthook__ = sys.excepthook
def handle_exception(*exc_info):
if exc_info[0] not in (KeyboardInterrupt, SystemExit):
client.captureException(exc_info=exc_info)
__excepthook__(*exc_info)
sys.excepthook = handle_exception