Skip to content

Commit

Permalink
Always grab last frame which represents application as culprit
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Jan 29, 2013
1 parent ab65d00 commit eb28f6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions raven/utils/stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,16 @@ def get_culprit(frames, *args, **kwargs):

best_guess = None
culprit = None
for frame in frames:
for frame in reversed(frames):
try:
culprit = '%s in %s' % (frame.get('module') or '<unknown module>',
frame.get('function') or '<unknown function>')
except KeyError:
continue

if frame.get('in_app', False):
if frame.get('in_app'):
return culprit
elif not best_guess:
best_guess = culprit
elif best_guess:
break
Expand Down

0 comments on commit eb28f6b

Please sign in to comment.