improve cache error handling