Widziałem wiele poradników. Tutaj przykładowy:
public class CustomException extends Exception{
public CustomException(String message){
super(message);
}
public CustomException(String message, Throwable throwable){
super(message,throwable);
}
}
Ale nie wiem jak to nwm... Z-try-catchować itd.