package com.kidgrow.common.exception;
|
|
import javax.validation.ConstraintViolation;
|
import java.util.Set;
|
|
/**
|
* 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
|
*
|
* @Description: 参数校验异常类<br>
|
* @Project: <br>
|
* @CreateDate: Created in 2020/2/3 17:08 <br>
|
* @Author: <a href="4345453@kidgrow.com">liuke</a>
|
*/
|
public class BeanValidateException extends RuntimeException {
|
|
private static final long serialVersionUID = -8810832233683666618L;
|
|
/**
|
* 具体异常信息
|
*/
|
private Set<ConstraintViolation<?>> errors;
|
|
public BeanValidateException(String message) {
|
super(message);
|
this.errors = null;
|
}
|
|
public BeanValidateException(Set<ConstraintViolation<?>> errors) {
|
this.errors = errors;
|
}
|
|
public BeanValidateException(String message, Set<ConstraintViolation<?>> errors) {
|
super(message);
|
this.errors = errors;
|
}
|
|
public BeanValidateException(String message, Throwable cause, Set<ConstraintViolation<?>> errors) {
|
super(message, cause);
|
this.errors = errors;
|
}
|
|
public BeanValidateException(Throwable cause, Set<ConstraintViolation<?>> errors) {
|
super(cause);
|
this.errors = errors;
|
}
|
|
public BeanValidateException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, Set<ConstraintViolation<?>> errors) {
|
super(message, cause, enableSuppression, writableStackTrace);
|
this.errors = errors;
|
}
|
|
public Set<ConstraintViolation<?>> getErrors() {
|
return errors;
|
}
|
|
public void setErrors(Set<ConstraintViolation<?>> errors) {
|
this.errors = errors;
|
}
|
}
|