diff options
Diffstat (limited to 'src/main/java/com/mesasoft/cn/exception/BusinessException.java')
| -rw-r--r-- | src/main/java/com/mesasoft/cn/exception/BusinessException.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/main/java/com/mesasoft/cn/exception/BusinessException.java b/src/main/java/com/mesasoft/cn/exception/BusinessException.java new file mode 100644 index 0000000..90f70b1 --- /dev/null +++ b/src/main/java/com/mesasoft/cn/exception/BusinessException.java @@ -0,0 +1,42 @@ +package com.mesasoft.cn.exception; + +import lombok.*; + +@EqualsAndHashCode(callSuper = true) +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BusinessException extends RuntimeException { + + /** + * 异常代码 + */ + @Builder.Default + private int status = 500; + + @Builder.Default + private String code = "500"; + + /** + * 异常信息 + */ + private String message; + + public BusinessException(String message) { + this.message = message; + } + + + public BusinessException(String message, Throwable e) { + super(message, e); + } + + public BusinessException(int status, String code, String message, Throwable e) { + super(message, e); + this.status = status; + this.code = code; + } + + +} |
