Code cleanup on error handling for ResourceCache.