def METHOD_NAME():
    """ Get the thread local cache context for this session. Raises an exception
        if the session was not initialized.
    """
    cache_context = getattr(cache_context_storage, "cache_context", None)
    if not cache_context:
        raise CacheException(
            "The cache context for this session was not initialized."
        )
    return cache_context