group rollbar messages around just the exception title

This commit is contained in:
Michael Gummelt
2015-06-26 13:40:07 -07:00
parent c8478d89b8
commit 4b894d1749
3 changed files with 10 additions and 2 deletions

View File

@@ -211,8 +211,15 @@ def _rollbar_track_err(conf, err, exit_code):
props = _base_properties(conf)
props['exit_code'] = exit_code
lines = err.split('\n')
if len(lines) >= 2:
title = lines[-2]
else:
title = err
props['stderr'] = err
try:
rollbar.report_message(err, 'error', extra_data=props)
rollbar.report_message(title, 'error', extra_data=props)
except Exception as e:
logger.exception(e)

View File

@@ -1,3 +1,3 @@
[core]
reporting = true
email = "test@mail.com"
reporting = true

View File

@@ -93,6 +93,7 @@ def test_exc():
# rollbar
props = _base_properties()
props['exit_code'] = 1
props['stderr'] = 'Traceback'
rollbar.report_message.assert_called_with('Traceback', 'error',
extra_data=props)