import requests


def exception_handler(request, exception):
    """Handles Invalid Scheme and Timeout Error from grequests.get

    Args:
        request (class 'grequests.AsyncRequest'): Request on which error
            occured
        exception (class 'requests.exceptions'): Exception occured

    Returns:
        str: Exception occured in string format
    """
    if type(exception) == requests.exceptions.ConnectionError:
        return "Connection Error"
    elif type(exception) == requests.exceptions.ConnectTimeout:
        return "Timeout Error"
    elif type(exception) == requests.exceptions.InvalidSchema:
        return "Invalid Schema"
    else:
        return type(exception).__name__