You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.1 KiB
Java
62 lines
1.1 KiB
Java
package com.glxp.api.exception;
|
|
|
|
/**
|
|
* 业务异常
|
|
*/
|
|
public final class ServiceException extends RuntimeException {
|
|
|
|
/**
|
|
* 错误码
|
|
*/
|
|
private Integer code;
|
|
|
|
/**
|
|
* 错误提示
|
|
*/
|
|
private String message;
|
|
|
|
/**
|
|
* 错误明细,内部调试错误
|
|
* <p>
|
|
*/
|
|
private String detailMessage;
|
|
|
|
/**
|
|
* 空构造方法,避免反序列化问题
|
|
*/
|
|
public ServiceException() {
|
|
}
|
|
|
|
public ServiceException(String message) {
|
|
this.message = message;
|
|
}
|
|
|
|
public ServiceException(String message, Integer code) {
|
|
this.message = message;
|
|
this.code = code;
|
|
}
|
|
|
|
public String getDetailMessage() {
|
|
return detailMessage;
|
|
}
|
|
|
|
@Override
|
|
public String getMessage() {
|
|
return message;
|
|
}
|
|
|
|
public Integer getCode() {
|
|
return code;
|
|
}
|
|
|
|
public ServiceException setMessage(String message) {
|
|
this.message = message;
|
|
return this;
|
|
}
|
|
|
|
public ServiceException setDetailMessage(String detailMessage) {
|
|
this.detailMessage = detailMessage;
|
|
return this;
|
|
}
|
|
}
|