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
import socket
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 ...'
try:
params = {
'args': sys.argv,
'stack': stack,
'user': getpass.getuser(),
'exception': last_tb,
}
request = urllib.urlopen(url, urllib.urlencode(params))
print request.read()
......@@ -30,9 +35,11 @@ def SendStack(stack, url='http://chromium-status.appspot.com/breakpad'):
def CheckForException():
last_tb = getattr(sys, 'last_traceback', None)
if last_tb and sys.last_type is not KeyboardInterrupt:
SendStack(''.join(traceback.format_tb(last_tb)))
last_value = getattr(sys, 'last_value', None)
if last_value and not isinstance(last_value, KeyboardInterrupt):
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
......
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