public static void Main()
string[] data = new[] { "1", "two", "ab2c" };
int[] result = ProcessInput(data);
foreach (var key in ex.Data.Keys)
Console.WriteLine($"Неправильный параметр {key}: {ex.Data[key]}");
static int[] ProcessInput(string[] data)
Exception processingException = null;
int[] result = new int[3];
for (int i = 0; i < data.Length; i++)
if (int.TryParse(data[i], out int val))
if (processingException == null)
processingException = new Exception("Ошибка обработки параметров");
processingException.Data.Add(paramName, data[i]);
if (processingException != null)
throw processingException;