using System.Collections.Generic;
public static class Program
public static void Main()
List<int> list = new(Enumerable.Range(1, 15));
Console.WriteLine($"Before RemoveAll: [{String.Join(", ", list)}]");
if (item == 10) throw new Exception();
bool removeIt = item % 2 == 1;
if (removeIt) Console.WriteLine($"Removing #{item}");
catch (Exception ex) { Console.WriteLine(ex); }
Console.WriteLine($"After RemoveAll: [{String.Join(", ", list)}]");