This commit is contained in:
白茶清欢 2025-06-16 18:53:28 +08:00
parent da6a532edb
commit c669c268f7

View File

@ -20,6 +20,7 @@ public class CustomException extends RuntimeException {
} }
public CustomException(ICustomExceptionConfig iCustomExceptionConfig) { public CustomException(ICustomExceptionConfig iCustomExceptionConfig) {
super(iCustomExceptionConfig.getMessage());
this.code = iCustomExceptionConfig.getCode(); this.code = iCustomExceptionConfig.getCode();
this.message = iCustomExceptionConfig.getMessage(); this.message = iCustomExceptionConfig.getMessage();
this.category = iCustomExceptionConfig.getCategory(); this.category = iCustomExceptionConfig.getCategory();
@ -28,12 +29,14 @@ public class CustomException extends RuntimeException {
// 根据code与 // 根据code与
public CustomException(ICustomExceptionConfig iCustomExceptionConfig, Object data) { public CustomException(ICustomExceptionConfig iCustomExceptionConfig, Object data) {
super(iCustomExceptionConfig.getMessage());
this.code = iCustomExceptionConfig.getCode(); this.code = iCustomExceptionConfig.getCode();
this.message = iCustomExceptionConfig.getMessage(); this.message = iCustomExceptionConfig.getMessage();
this.category = iCustomExceptionConfig.getCategory(); this.category = iCustomExceptionConfig.getCategory();
this.data = data; this.data = data;
} }
public CustomException(String category, String code, Object data) { public CustomException(String category, String code, Object data) {
super(HashMapCache.getInstance().getMessage(category, code));
this.category = category; this.category = category;
this.code = code; this.code = code;
this.message = HashMapCache.getInstance().getMessage(category, code); this.message = HashMapCache.getInstance().getMessage(category, code);