Checking if need to clear caches on error