diff --git a/src/main/java/cn/zhangdeman/exception/CustomException.java b/src/main/java/cn/zhangdeman/exception/CustomException.java index cedb88f..5cf96d4 100644 --- a/src/main/java/cn/zhangdeman/exception/CustomException.java +++ b/src/main/java/cn/zhangdeman/exception/CustomException.java @@ -20,6 +20,7 @@ public class CustomException extends RuntimeException { } public CustomException(ICustomExceptionConfig iCustomExceptionConfig) { + super(iCustomExceptionConfig.getMessage()); this.code = iCustomExceptionConfig.getCode(); this.message = iCustomExceptionConfig.getMessage(); this.category = iCustomExceptionConfig.getCategory(); @@ -28,12 +29,14 @@ public class CustomException extends RuntimeException { // 根据code与 public CustomException(ICustomExceptionConfig iCustomExceptionConfig, Object data) { + super(iCustomExceptionConfig.getMessage()); this.code = iCustomExceptionConfig.getCode(); this.message = iCustomExceptionConfig.getMessage(); this.category = iCustomExceptionConfig.getCategory(); this.data = data; } public CustomException(String category, String code, Object data) { + super(HashMapCache.getInstance().getMessage(category, code)); this.category = category; this.code = code; this.message = HashMapCache.getInstance().getMessage(category, code);