java-experiment/src/main/java/com/example/exception/CustomException.java
闵宪瑞 03d32a62b3 add
2025-05-27 13:41:58 +08:00

36 lines
701 B
Java

package com.example.exception;
import com.example.common.enums.ResultCodeEnum;
public class CustomException extends RuntimeException {
private String code;
private String msg;
public CustomException(String code, String msg) {
this.code = code;
this.msg = msg;
}
public CustomException(ResultCodeEnum resultCodeEnum) {
this.code = resultCodeEnum.code;
this.msg = resultCodeEnum.msg;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}