zsw-farm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

55 lines
1.0 KiB

package com.zsw.exception;
/**
* 运行期异常基类
*
* @author 云久
* @version 1.0
* @see Exception
*/
public abstract class BaseCheckedException extends Exception implements BaseException {
private static final long serialVersionUID = 2706069899924648586L;
/**
* 异常信息
*/
protected String message;
/**
* 具体异常码
*/
protected int code;
public BaseCheckedException(int code, String message) {
super(message);
this.code = code;
this.message = message;
}
public BaseCheckedException(int code, String format, Object... args) {
super(String.format(format, args));
this.code = code;
this.message = String.format(format, args);
}
@Override
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}