From ddb2f99e7a8c2bdc9ada18eb23c3af1eee678d94 Mon Sep 17 00:00:00 2001 From: abazov73 <92822431+abazov73@users.noreply.github.com> Date: Fri, 2 Dec 2022 00:12:05 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BD=D0=B5=D0=B4=D0=BE=D1=81=D1=82=D0=B0=D1=8E=D1=89?= =?UTF-8?q?=D0=B8=D0=B9=20=D0=BF=D1=80=D0=BE=D0=B1=D1=80=D0=BE=D1=81=20Air?= =?UTF-8?q?BomberNotFoundException=20=D0=B2=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=20Insert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirBomber/AirBomber/SetAirBombersGeneric.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AirBomber/AirBomber/SetAirBombersGeneric.cs b/AirBomber/AirBomber/SetAirBombersGeneric.cs index f5047e1..f494dd8 100644 --- a/AirBomber/AirBomber/SetAirBombersGeneric.cs +++ b/AirBomber/AirBomber/SetAirBombersGeneric.cs @@ -55,7 +55,10 @@ namespace AirBomber /// public int Insert(T airBomber, int position) { - if (position < 0 || position >= _maxCount) return -1; + if (position < 0 || position >= _maxCount) + { + throw new AirBomberNotFoundException(position); + } if (_places.Count + 1 >= _maxCount) { throw new StorageOverflowException(_maxCount);