def parse_curl_error(proc_stderr):
    """Report curl failure.

    Args:
        proc_stderr (str): Stderr returned from curl command.

    Returns:
        str: Reason for curl failure.
    """
    curl_err = ""
    if isinstance(proc_stderr, bytes):
        proc_stderr = proc_stderr.decode("utf-8")
    try:
        curl_err = proc_stderr.rstrip("\n")
        curl_err = curl_err.split(None, 2)[2]
    except IndexError:
        pass

    return curl_err