Commit 7aeac3ee authored by maruel@chromium.org's avatar maruel@chromium.org

Fix KeyboardInterrupt exception filtering.

Add exception information and not just the stack trace.
Make the url easier to change at runtime.

Review URL: http://codereview.chromium.org/2109001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47179 0039d316-1c4b-4281-b951-d872f2087c98
parent 9addb1e1
...@@ -13,14 +13,19 @@ import traceback ...@@ -13,14 +13,19 @@ import traceback
import socket import socket
import sys import sys
# Configure these values.
DEFAULT_URL = 'http://chromium-status.appspot.com/breakpad'
def SendStack(stack, url='http://chromium-status.appspot.com/breakpad'): def SendStack(last_tb, stack, url=None):
if not url:
url = DEFAULT_URL
print 'Sending crash report ...' print 'Sending crash report ...'
try: try:
params = { params = {
'args': sys.argv, 'args': sys.argv,
'stack': stack, 'stack': stack,
'user': getpass.getuser(), 'user': getpass.getuser(),
'exception': last_tb,
} }
request = urllib.urlopen(url, urllib.urlencode(params)) request = urllib.urlopen(url, urllib.urlencode(params))
print request.read() print request.read()
...@@ -30,9 +35,11 @@ def SendStack(stack, url='http://chromium-status.appspot.com/breakpad'): ...@@ -30,9 +35,11 @@ def SendStack(stack, url='http://chromium-status.appspot.com/breakpad'):
def CheckForException(): def CheckForException():
last_tb = getattr(sys, 'last_traceback', None) last_value = getattr(sys, 'last_value', None)
if last_tb and sys.last_type is not KeyboardInterrupt: if last_value and not isinstance(last_value, KeyboardInterrupt):
SendStack(''.join(traceback.format_tb(last_tb))) last_tb = getattr(sys, 'last_traceback', None)
if last_tb:
SendStack(repr(last_value), ''.join(traceback.format_tb(last_tb)))
if (not 'test' in sys.modules['__main__'].__file__ and if (not 'test' in sys.modules['__main__'].__file__ and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment