Fix cache error handling