-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1d6e8a
commit 27739d4
Showing
7 changed files
with
210 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/AbstractException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cn.hippo4j.common.web.exception; | ||
|
||
import lombok.Getter; | ||
|
||
/** | ||
* Abstract exception. | ||
* | ||
* @author chen.ma | ||
* @date 2022/3/2 20:01 | ||
*/ | ||
public class AbstractException extends RuntimeException { | ||
|
||
@Getter | ||
public final ErrorCode errorCode; | ||
|
||
public AbstractException(String message, Throwable throwable, ErrorCode errorCode) { | ||
super(message, throwable); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/ErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cn.hippo4j.common.web.exception; | ||
|
||
/** | ||
* 错误码抽象接口. | ||
* | ||
* @author chen.ma | ||
* @date 2021/9/16 15:39 | ||
*/ | ||
public interface ErrorCode { | ||
|
||
/** | ||
* 错误码. | ||
* | ||
* @return | ||
*/ | ||
String getCode(); | ||
|
||
/** | ||
* 错误信息. | ||
* | ||
* @return | ||
*/ | ||
String getMessage(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters