Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1125 from peterbe/print-all-error-information-in-…
…list-jobs

print all error information in --list-jobs
  • Loading branch information
Tony Young committed Mar 8, 2013
2 parents 3a75f08 + 9f2847d commit 4a90f10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion socorro/cron/crontabber.py
Expand Up @@ -611,7 +611,10 @@ def list_jobs(self, stream=None):
if info.get('last_error'):
print >>stream, 'Error!!'.ljust(PAD),
print >>stream, '(%s times)' % info['error_count']
print >>stream, info['last_error']['traceback']
print >>stream, 'Traceback (most recent call last):'
print >>stream, info['last_error']['traceback'],
print >>stream, info['last_error']['type'].__name__ + ':',
print >>stream, info['last_error']['value']
print >>stream, ''

def reset_job(self, description):
Expand Down
4 changes: 4 additions & 0 deletions socorro/unittest/cron/test_crontabber.py
Expand Up @@ -532,6 +532,10 @@ def mock_utc_now():
outputs['trouble'], re.I))
self.assertTrue(re.findall('raise NameError',
outputs['trouble'], re.I))
# since the exception type and exception value is also displayed
# in the output we can expect these to be shown twice
self.assertEqual(outputs['trouble'].count('NameError'), 2)
self.assertEqual(outputs['trouble'].count('Trouble!!'), 2)
self.assertTrue(re.findall('7d @ 03:00',
outputs['basic-job'], re.I))

Expand Down

0 comments on commit 4a90f10

Please sign in to comment.