-
User-defined Custom Exception in Java.
almost 9 years ago
-
over 8 years ago
This is a more elaborate custom exception: public class EntityHandlingException extends Exception {
/** * Constructs an instance of <code>EntityHandlingException</code> with the * specified detail message. * * @param msg * the detail message. */ public EntityHandlingException(String msg) { super(msg); } /** * Constructs an instance of <code>EntityHandlingException</code> with the * specified cause. * * @param cause * the cause. */ public EntityHandlingException(Throwable cause) { super(cause); } /** * Constructs an instance of <code>EntityHandlingException</code> with the * specified detail message and cause. * * @param message * the detail message. * @param cause * the cause. */ public EntityHandlingException(String message, Throwable cause) { super(message, cause); }
}
-
1 Comment(s)