Добавлен недостающий проброс AirBomberNotFoundException в методе Insert

This commit is contained in:
abazov73 2022-12-02 00:12:05 +04:00
parent 3bc4f02768
commit ddb2f99e7a

View File

@ -55,7 +55,10 @@ namespace AirBomber
/// <returns></returns> /// <returns></returns>
public int Insert(T airBomber, int position) 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) if (_places.Count + 1 >= _maxCount)
{ {
throw new StorageOverflowException(_maxCount); throw new StorageOverflowException(_maxCount);