@authenticated_json_post_view
@has_request_variables
def json_report_error(request, user_profile, message=REQ(), stacktrace=REQ(), ui_message=REQ(validator=check_bool), user_agent=REQ(), href=REQ(), log=REQ(), more_info=REQ(validator=check_dict([]), default=None)):
 if (not settings.ERROR_REPORTING):
  return json_success()
 if js_source_map:
  stacktrace = js_source_map.annotate_stacktrace(stacktrace)
 try:
  version = subprocess.check_output(['git', 'log', 'HEAD^..HEAD', '--oneline'], universal_newlines=True)
 except Exception:
  version = None
 queue_json_publish('error_reports', dict(type='browser', report=dict(user_email=user_profile.email, user_full_name=user_profile.full_name, user_visible=ui_message, server_path=settings.DEPLOY_ROOT, version=version, user_agent=user_agent, href=href, message=message, stacktrace=stacktrace, log=log, more_info=more_info)), (lambda x: None))
 return json_success()

@ authenticated_json_post_view @ has_request_variables def json_report_error ( request , user_profile , message = REQ ( ) , stacktrace = REQ ( ) , ui_message = REQ ( validator = check_bool ) , user_agent = REQ ( ) , href = REQ ( ) , log = REQ ( ) , more_info = REQ ( validator = check_dict ( [ ] ) , default = None ) ) : if ( not settings . ERROR_REPORTING ) : return json_success ( ) if js_source_map : stacktrace = js_source_map . annotate_stacktrace ( stacktrace ) try : version = subprocess . check_output ( [ 'git' , 'log' , 'HEAD^..HEAD' , '--oneline' ] , universal_newlines = True ) except Exception : version = None queue_json_publish ( 'error_reports' , dict ( type = 'browser' , report = dict ( user_email = user_profile . email , user_full_name = user_profile . full_name , user_visible = ui_message , server_path = settings . DEPLOY_ROOT , version = version , user_agent = user_agent , href = href , message = message , stacktrace = stacktrace , log = log , more_info = more_info ) ) , ( lambda x : None ) ) return json_success ( )
accepts an error report and stores in a queue for processing .