diff --git a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs index 7c0b71b..cd89687 100644 --- a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs @@ -119,7 +119,7 @@ where T : class { throw new PositionOutOfCollectionException(position); } - if (_collection[position] == null) throw new ObjectNotFoundException(position); + if (_collection[position] == null) throw new ObjectNotFoundException(position);//выброс1 T obj = _collection[position]; _collection[position] = null; return obj; diff --git a/ProjectSportCar/ProjectSportCar/Exceptions/ObjectNotFoundException.cs b/ProjectSportCar/ProjectSportCar/Exceptions/ObjectNotFoundException.cs index a239c59..d2d9d0e 100644 --- a/ProjectSportCar/ProjectSportCar/Exceptions/ObjectNotFoundException.cs +++ b/ProjectSportCar/ProjectSportCar/Exceptions/ObjectNotFoundException.cs @@ -9,7 +9,7 @@ namespace ProjectAiroplane.Exceptions; [Serializable] internal class ObjectNotFoundException : ApplicationException { - public ObjectNotFoundException(int i) : base("Не найден объект по позиции " + i) { } + public ObjectNotFoundException(int i) : base("Не найден объект по позиции " + i) { }//обработка1 public ObjectNotFoundException() : base() { } diff --git a/ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs b/ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs index e6968b6..5949fca 100644 --- a/ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs +++ b/ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs @@ -77,7 +77,7 @@ public partial class FormPlaneCollection : Form } } - catch (ObjectNotFoundException) { MessageBox.Show("Не удалось добавить объект"); + catch (ObjectNotFoundException) { MessageBox.Show("Не удалось добавить объект");//ловлю ошибку1 }