自定义异常
/**
* 自定义异常
*/
public class CustomException extends RuntimeException{
private Integer code;
private String message;
CustomException(){}
CustomException(Integer code, String message ){
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
public String toString(){
return "CustomException{code="+code+",message='"+message+"'}";
}
}

浙公网安备 33010602011771号