新增异常实例化方式
This commit is contained in:
parent
ff96f647e6
commit
4a4e1a6a7a
@ -21,6 +21,13 @@ public class CustomException extends RuntimeException {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public CustomException(ICustomExceptionConfig iCustomExceptionConfig) {
|
||||
this.code = iCustomExceptionConfig.getCode();
|
||||
this.message = iCustomExceptionConfig.getMessage();
|
||||
this.category = iCustomExceptionConfig.getCategory();
|
||||
this.data = null;
|
||||
}
|
||||
|
||||
// 根据code与
|
||||
public CustomException(ICustomExceptionConfig iCustomExceptionConfig, Object data) {
|
||||
this.code = iCustomExceptionConfig.getCode();
|
||||
@ -31,7 +38,7 @@ public class CustomException extends RuntimeException {
|
||||
public CustomException(String category, String code, Object data) {
|
||||
this.category = category;
|
||||
this.code = code;
|
||||
this.message = HashMapCache.getInstance().getCodeMessage(category, code);
|
||||
this.message = HashMapCache.getInstance().getMessage(category, code);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user