def METHOD_NAME(proxy, exception=None):
    """
    Record a problem with the proxy server `proxy`, optionally passing in the
    exact exception that occured in the calling code.
    """
    global MAYBE_BROKEN_PROXIES
    error_dict = dict(proxy=proxy, timestamp=time.time(), exception=exception)
    if proxy in MAYBE_BROKEN_PROXIES:
        proxy_errors = MAYBE_BROKEN_PROXIES[proxy]
        recent_proxy_errors = []
        for proxy_error in proxy_errors:
            if (time.time() - proxy_error["timestamp"]) < ERROR_FORGET_TIME * 60:
                recent_proxy_errors.append(proxy_error)
        recent_proxy_errors.append(error_dict)
        MAYBE_BROKEN_PROXIES[proxy] = recent_proxy_errors
        if len(recent_proxy_errors) >= ERROR_THRESHOLD:
            reason = str(exception).split("\n")[0] if exception else None
            add_to_broken_proxy_list(proxy, reason=reason)
    else:
        MAYBE_BROKEN_PROXIES[proxy] = [error_dict]