1. @Data
    2. public class CMSException extends RuntimeException {
    3. private Integer code;
    4. public CMSException(Integer code, String message) {
    5. super(message);
    6. this.code = code;
    7. }
    8. public CMSException(ResultCodeEnum resultCodeEnum) {
    9. super(resultCodeEnum.getMessage());
    10. this.code = resultCodeEnum.getCode();
    11. }
    12. @Override
    13. public String toString() {
    14. return "CMSException{" + "code=" + code + ", message=" + this.getMessage() + '}';
    15. }
    16. }
    1. @Data
    2. public class BizException extends RuntimeException {
    3. private String retCode;
    4. private String retMessage;
    5. public BizException() {
    6. super();
    7. }
    8. public BizException(String retCode, String retMessage) {
    9. this.retCode = retCode;
    10. this.retMessage = retMessage;
    11. }
    12. }