When cache returns a boolean instead of cacheElement, throws exception.