def METHOD_NAME(self, redis_url=None, **kwargs):
    try:
        if redis_url:
            with from_url(redis_url, **kwargs) as conn:
                conn.ping()  # exceptions may be raised upon ping
        else:
            with Redis(**kwargs) as conn:
                conn.ping()  # exceptions may be raised upon ping
    except (ConnectionRefusedError, exceptions.ConnectionError, exceptions.TimeoutError) as e:
        self.add_error(ServiceUnavailable(f"Unable to connect to Redis: {type(e).__name__}"), e)
    except Exception as e:
        self.add_error(ServiceUnavailable("Unknown error"), e)