def report_error(error, exc_info, request=None, extra_data=None, level=None):
 if (HAS_ROLLBAR and hasattr(settings, u'ROLLBAR')):
  rollbar.report_exc_info(exc_info, request, extra_data=extra_data, level=level)
 LOGGER.error(u'Handled exception %s: %s', error.__class__.__name__, force_text(error).encode(u'utf-8'))
 if (sys.argv[1:2] == [u'test']):
  traceback.print_exc()

def report_error ( error , exc_info , request = None , extra_data = None , level = None ) : if ( HAS_ROLLBAR and hasattr ( settings , u'ROLLBAR' ) ) : rollbar . report_exc_info ( exc_info , request , extra_data = extra_data , level = level ) LOGGER . error ( u'Handled exception %s: %s' , error . __class__ . __name__ , force_text ( error ) . encode ( u'utf-8' ) ) if ( sys . argv [ 1 : 2 ] == [ u'test' ] ) : traceback . print_exc ( )
wrapper for error reporting this can be used for store exceptions in error reporting solutions as rollbar while handling error gracefully and giving user cleaner message .