Added own exceptions

This commit is contained in:
Сергей Полевой 2022-12-05 22:04:47 +04:00
parent 8abded35c8
commit bbb24c454f
2 changed files with 40 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}