From 2c1605cadc22fb8d4cb9f0b9fd44839dcc9c4385 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 29 Dec 2023 09:46:33 +0400 Subject: [PATCH] 30% --- DumpTruck/DumpTruck/StorageOverException.cs | 21 +++++++++++++++++++ DumpTruck/DumpTruck/TruckNotFoundException.cs | 19 +++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 DumpTruck/DumpTruck/StorageOverException.cs create mode 100644 DumpTruck/DumpTruck/TruckNotFoundException.cs diff --git a/DumpTruck/DumpTruck/StorageOverException.cs b/DumpTruck/DumpTruck/StorageOverException.cs new file mode 100644 index 0000000..5cc4829 --- /dev/null +++ b/DumpTruck/DumpTruck/StorageOverException.cs @@ -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 DumpTruck.Exceptions +{ + [Serializable] + internal class StorageOverException : ApplicationException + { + public StorageOverException(int count) : base($"В наборе превышено допустимое количество: { count}") { } + public StorageOverException() : base() { } + public StorageOverException(string message) : base(message) { } + public StorageOverException(string message, Exception exception) + : base(message, exception) { } + protected StorageOverException(SerializationInfo info, + StreamingContext contex) : base(info, contex) { } + } +} diff --git a/DumpTruck/DumpTruck/TruckNotFoundException.cs b/DumpTruck/DumpTruck/TruckNotFoundException.cs new file mode 100644 index 0000000..c71851d --- /dev/null +++ b/DumpTruck/DumpTruck/TruckNotFoundException.cs @@ -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 DumpTruck.Exceptions +{ + [Serializable] + internal class TruckNotFoundException : ApplicationException + { + public TruckNotFoundException(int i) : base($"Не найден объект по позиции { i}") { } + public TruckNotFoundException() : base() { } + public TruckNotFoundException(string message) : base(message) { } + public TruckNotFoundException(string message, Exception exception) : base(message, exception) { } + protected TruckNotFoundException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } + } +}