private void FillFrequencyOfWords() { try { int rowsCount = InputNumberOfRows(); frequencyOfWords = new Dictionary <string, int>(); while (rowsCount > 0) { var inputedRow = Console.ReadLine(); KeyValuePair <string, int> processedRow = SyllableRecognizer.RecognizeFrequencyOfWord(inputedRow); frequencyOfWords.Add(processedRow); rowsCount--; } } // two different types of exceptions catch (ArgumentException argException) { throw new ArgumentException("Строка имеет неверный формат", argException); } catch (Exception generalException) { throw new Exception("Строка имеет неверный формат", generalException); } }