def METHOD_NAME(response):
    """
    Raises an SendGridAPIError if the request has returned an error
    """
    if response.status_code >= 300:
        raise SendGridAPIError(response.body.decode("utf-8"))