def ReportError(err, is_crash):
    'Report the anonymous crash information to the Error Reporting service.\n\n  Args:\n    err: Exception, the error that caused the crash.\n    is_crash: bool, True if this is a crash, False if it is a user error.\n  '
    if properties.VALUES.core.disable_usage_reporting.GetBool():
        return
    stacktrace = traceback.format_exc(err)
    stacktrace = error_reporting_util.RemovePrivateInformationFromTraceback(stacktrace)
    command = properties.VALUES.metrics.command_name.Get()
    cid = metrics.GetCIDIfMetricsEnabled()
    client = _GetReportingClient()
    reporter = util.ErrorReporting(client)
    try:
        method_config = client.projects_events.GetMethodConfig('Report')
        request = reporter.GenerateReportRequest(error_message=stacktrace, service=(CRASH_SERVICE if is_crash else ERROR_SERVICE), version=config.CLOUD_SDK_VERSION, project=CRASH_PROJECT, request_url=command, user=cid)
        http_request = client.projects_events.PrepareHttpRequest(method_config, request)
        metrics.CustomBeacon(http_request.url, http_request.http_method, http_request.body, http_request.headers)
    except apitools_exceptions.Error as e:
        log.file_only_logger.error('Unable to report crash stacktrace:\n{0}'.format(console_attr.EncodeForConsole(e)))
Report the anonymous crash information to the Error Reporting service.

Args:
  err: Exception, the error that caused the crash.
  is_crash: bool, True if this is a crash, False if it is a user error.
def ReportError(err, is_crash):
    'Report the anonymous crash information to the Error Reporting service.\n\n  Args:\n    err: Exception, the error that caused the crash.\n    is_crash: bool, True if this is a crash, False if it is a user error.\n  '
    if properties.VALUES.core.disable_usage_reporting.GetBool():
        return
    stacktrace = traceback.format_exc(err)
    stacktrace = error_reporting_util.RemovePrivateInformationFromTraceback(stacktrace)
    command = properties.VALUES.metrics.command_name.Get()
    cid = metrics.GetCIDIfMetricsEnabled()
    client = _GetReportingClient()
    reporter = util.ErrorReporting(client)
    try:
        method_config = client.projects_events.GetMethodConfig('Report')
        request = reporter.GenerateReportRequest(error_message=stacktrace, service=(CRASH_SERVICE if is_crash else ERROR_SERVICE), version=config.CLOUD_SDK_VERSION, project=CRASH_PROJECT, request_url=command, user=cid)
        http_request = client.projects_events.PrepareHttpRequest(method_config, request)
        metrics.CustomBeacon(http_request.url, http_request.http_method, http_request.body, http_request.headers)
    except apitools_exceptions.Error as e:
        log.file_only_logger.error('Unable to report crash stacktrace:\n{0}'.format(console_attr.EncodeForConsole(e)))