добавление классов-наследников от Exception

This commit is contained in:
Артем Харламов 2022-12-17 15:43:16 +04:00
parent 13d9bfb23d
commit f3a61092eb
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Stormtrooper
{
[Serializable]
internal class StorageOverflowException : ApplicationException
{
public StorageOverflowException(int count) : base($"В наборе превышено допустимое количество: {count}") { }
public StorageOverflowException() : base() { }
public StorageOverflowException(string message) : base(message) { }
public StorageOverflowException(string message, Exception exception) : base(message, exception) { }
protected StorageOverflowException(SerializationInfo info, StreamingContext contex) : base(info, contex) { }
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Stormtrooper
{
[Serializable]
internal class StormtrooperNotFoundException : ApplicationException
{
public StormtrooperNotFoundException(int i) : base($"Не найден объект по позиции {i}") { }
public StormtrooperNotFoundException() : base("Выход за границы") { }
public StormtrooperNotFoundException(string message) : base(message) { }
public StormtrooperNotFoundException(string message, Exception exception) : base(message, exception) { }
protected StormtrooperNotFoundException(SerializationInfo info, StreamingContext contex) : base(info, contex) { }
}
}