diff --git a/ArmoredCar/ArmoredCar/MapsCollection.cs b/ArmoredCar/ArmoredCar/MapsCollection.cs index 63c2468..b81c4f0 100644 --- a/ArmoredCar/ArmoredCar/MapsCollection.cs +++ b/ArmoredCar/ArmoredCar/MapsCollection.cs @@ -109,14 +109,14 @@ namespace ArmoredCar { if (!File.Exists(filename)) { - return false; + throw new FileNotFoundException("Файл не найден"); } using (FileStream f = new(filename, FileMode.Open)) using (StreamReader sw = new(f, Encoding.UTF8)) { if (!sw.ReadLine().Contains("MapsCollection")) - return false; + throw new FileFormatException("Формат данных в файле не правильный"); string? line; _mapStorages.Clear(); while ((line = sw.ReadLine()) != null)