diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BadRequestException.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BadRequestException.java index 95f6afd3..280e5f0b 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BadRequestException.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BadRequestException.java @@ -16,6 +16,8 @@ package top.charles7c.continew.starter.core.exception; +import java.io.Serial; + /** * 自定义验证异常-错误请求 * @@ -24,10 +26,21 @@ package top.charles7c.continew.starter.core.exception; */ public class BadRequestException extends BaseException { + @Serial + private static final long serialVersionUID = 1L; + public BadRequestException() { } public BadRequestException(String message) { super(message); } + + public BadRequestException(Throwable cause) { + super(cause); + } + + public BadRequestException(String message, Throwable cause) { + super(message, cause); + } } diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BaseException.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BaseException.java index e1058073..efd069e1 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BaseException.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BaseException.java @@ -16,6 +16,8 @@ package top.charles7c.continew.starter.core.exception; +import java.io.Serial; + /** * 自定义异常基类 * @@ -24,10 +26,21 @@ package top.charles7c.continew.starter.core.exception; */ public class BaseException extends RuntimeException { + @Serial + private static final long serialVersionUID = 1L; + public BaseException() { } public BaseException(String message) { super(message); } + + public BaseException(Throwable cause) { + super(cause); + } + + public BaseException(String message, Throwable cause) { + super(message, cause); + } } diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BusinessException.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BusinessException.java index 4f71a194..73f6b1f5 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BusinessException.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/exception/BusinessException.java @@ -16,6 +16,8 @@ package top.charles7c.continew.starter.core.exception; +import java.io.Serial; + /** * 业务异常 * @@ -24,10 +26,21 @@ package top.charles7c.continew.starter.core.exception; */ public class BusinessException extends BaseException { + @Serial + private static final long serialVersionUID = 1L; + public BusinessException() { } public BusinessException(String message) { super(message); } + + public BusinessException(Throwable cause) { + super(cause); + } + + public BusinessException(String message, Throwable cause) { + super(message, cause); + } }