From bbb24c454fb2c183c63b82c25e7a360a07810795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9F=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2=D0=BE=D0=B9?= Date: Mon, 5 Dec 2022 22:04:47 +0400 Subject: [PATCH] Added own exceptions --- ArtilleryNotFoundException.java | 21 +++++++++++++++++++++ StorageOverflowException.java | 19 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 ArtilleryNotFoundException.java create mode 100644 StorageOverflowException.java diff --git a/ArtilleryNotFoundException.java b/ArtilleryNotFoundException.java new file mode 100644 index 0000000..1faca14 --- /dev/null +++ b/ArtilleryNotFoundException.java @@ -0,0 +1,21 @@ +public class ArtilleryNotFoundException extends RuntimeException { + public ArtilleryNotFoundException() { + + } + + public ArtilleryNotFoundException(int i) { + super("Не найден объект по позиции " + i); + } + + public ArtilleryNotFoundException(String message) { + super(message); + } + + public ArtilleryNotFoundException(String message, Throwable cause) { + super(message, cause); + } + + public ArtilleryNotFoundException(Throwable cause) { + super(cause); + } +} diff --git a/StorageOverflowException.java b/StorageOverflowException.java new file mode 100644 index 0000000..2151c07 --- /dev/null +++ b/StorageOverflowException.java @@ -0,0 +1,19 @@ +public class StorageOverflowException extends RuntimeException{ + public StorageOverflowException() { + } + + public StorageOverflowException(String message) { + super(message); + } + public StorageOverflowException(int count) { + super("В наборе превышено допустимое количество: " + count); + } + + public StorageOverflowException(String message, Throwable cause) { + super(message, cause); + } + + public StorageOverflowException(Throwable cause) { + super(cause); + } +} \ No newline at end of file