提交 | 用户 | 时间
|
71e81e
|
1 |
package cn.stylefeng.guns.base.auth.exception; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.roses.kernel.model.exception.AbstractBaseExceptionEnum; |
|
4 |
import lombok.Data; |
|
5 |
|
|
6 |
/** |
|
7 |
* 认证失败(账号密码错误,账号被冻结,token过期等) |
|
8 |
* |
|
9 |
* @author fengshuonan |
|
10 |
* @Date 2019/7/18 22:18 |
|
11 |
*/ |
|
12 |
@Data |
|
13 |
public class AuthException extends RuntimeException { |
|
14 |
|
|
15 |
private Integer code; |
|
16 |
private String errorMessage; |
|
17 |
|
|
18 |
public AuthException() { |
|
19 |
super("认证失败!"); |
|
20 |
this.code = 500; |
|
21 |
this.errorMessage = "认证失败!"; |
|
22 |
} |
|
23 |
|
|
24 |
public AuthException(AbstractBaseExceptionEnum exception) { |
|
25 |
super(exception.getMessage()); |
|
26 |
this.code = exception.getCode(); |
|
27 |
this.errorMessage = exception.getMessage(); |
|
28 |
} |
|
29 |
|
|
30 |
} |