From 242f4cedf1ca5749a85ea1a78a57b279e5981188 Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Wed, 16 Nov 2022 18:58:31 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArmoredCar/ArmoredCar/MapsCollection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)