matrix.boot.common.exception.I18nBusinessException Maven / Gradle / Ivy
package matrix.boot.common.exception;
/**
* 国际化业务异常类(已知业务异常,不打印堆栈信息)
*
* @author wangcheng
* date 2022/10/28
*/
public class I18nBusinessException extends RuntimeException {
private static final long serialVersionUID = 1L;
/**
* 异常信息编码
*/
private String messageCode;
/**
* 错误编码
*/
private Integer errorCode;
public I18nBusinessException() {
super();
}
public I18nBusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
public I18nBusinessException(String message, Throwable cause) {
super(message, cause);
}
public I18nBusinessException(String messageCode) {
super(messageCode);
this.messageCode = messageCode;
}
public I18nBusinessException(String messageCode, String message) {
super(message);
this.messageCode = messageCode;
}
public I18nBusinessException(Throwable cause) {
super(cause.getMessage(), cause);
}
public String getMessageCode() {
return messageCode;
}
public I18nBusinessException setMessageCode(String messageCode) {
this.messageCode = messageCode;
return this;
}
public Integer getErrorCode() {
return errorCode;
}
public I18nBusinessException setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
return this;
}
}