create my exception's classes

This commit is contained in:
ekallin 2023-11-19 13:03:18 +04:00
parent f3d755c66d
commit 64018e06bd
2 changed files with 43 additions and 0 deletions
ProjectElectricLocomotive/ProjectElectricLocomotive

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

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace ProjectElectricLocomotive
{
[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) { }
}
}