forked from kidgrow-microservices-platform

zhaoxiaohao
2021-02-06 01d42cce4abdbd5d232d241b1b6b662314cf3999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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;
    }
}