import requests
import logging


def check_internet_connection() -> bool:
    """
    Checks if we have an internet connection by submitting a
    GET request to google.com.
    """
    try:
        r = requests.get("https://google.com")
        if r.status_code == 200:
            return True
        else:
            raise requests.exceptions.ConnectionError

    except requests.exceptions.ConnectionError as e:
        logging.error(f"NO INTERNET CONNECTION:{e}")
        return False
    except requests.exceptions.HTTPError as e:
        logging.error(f"INVALID HTTP RESPONSE:{e}")
        return False