def slim_exception_data(instance, frame_allowance=settings.SENTRY_MAX_STACKTRACE_FRAMES):
 frames = []
 for exception in instance.values:
  if (not exception.stacktrace):
   continue
  frames.extend(exception.stacktrace.frames)
 slim_frame_data(frames, frame_allowance)

def slim_exception_data ( instance , frame_allowance = settings . SENTRY_MAX_STACKTRACE_FRAMES ) : frames = [ ] for exception in instance . values : if ( not exception . stacktrace ) : continue frames . extend ( exception . stacktrace . frames ) slim_frame_data ( frames , frame_allowance )
removes various excess metadata from middle frames which go beyond frame_allowance .