1.自定义异常
public class CreateFailedException extends RuntimeException{
public CreateFailedException(String errMsg) {
super(errMsg);
}
/**
* Construct a new runtime exception with the cause
*
* @param cause cause
*/
public CreateFailedException(Throwable cause) {
super(cause);
}
/**
* Construct a new runtime exception with the detail message and cause
*
* @param errMsg message
* @param cause cause
*/
public CreateFailedException(String errMsg, Throwable cause) {
super(errMsg, cause);
}
}