-
Notifications
You must be signed in to change notification settings - Fork 1
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
yongjingchuan
authored and
yongjingchuan
committed
Aug 20, 2020
1 parent
2be0bec
commit 5eabe84
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
src/main/java/com/cy/generate/common/exception/CommonException.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,55 @@ | ||
package com.cy.generate.common.exception; | ||
|
||
import com.cy.generate.common.ErrorCode; | ||
|
||
/** | ||
* @Description: | ||
* @Author: YongJingChuan | ||
* @Date: 2020/8/20 16:20 | ||
*/ | ||
public class CommonException extends RuntimeException { | ||
|
||
private ErrorCode errorCode; | ||
|
||
public CommonException() { | ||
} | ||
|
||
public CommonException(String msg) { | ||
super(msg); | ||
} | ||
|
||
public CommonException(Throwable throwable) { | ||
super(throwable); | ||
} | ||
|
||
public CommonException(String msg, Throwable throwable) { | ||
super(msg, throwable); | ||
} | ||
|
||
public CommonException(ErrorCode errorCode) { | ||
super(errorCode.getMessage()); | ||
} | ||
|
||
public CommonException(String msg, ErrorCode errorCode) { | ||
super(msg); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
public CommonException(Throwable throwable, ErrorCode errorCode) { | ||
super(throwable); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
public CommonException(String msg, Throwable throwable, ErrorCode errorCode) { | ||
super(msg, throwable); | ||
this.errorCode = errorCode; | ||
} | ||
|
||
public ErrorCode getErrorCode() { | ||
return errorCode; | ||
} | ||
|
||
public void setErrorCode(ErrorCode errorCode) { | ||
this.errorCode = errorCode; | ||
} | ||
} |