package com.sinata.rest.core.exception;
|
|
import com.sinata.rest.core.support.StrKit;
|
|
/**
|
* 抽象接口
|
*
|
* @author fengshuonan
|
* @date 2017-12-28-下午10:27
|
*/
|
public interface ServiceExceptionEnum {
|
|
/**
|
* 获取异常编码
|
*/
|
Integer getCode();
|
|
/**
|
* 获取异常信息
|
*/
|
String getMessage();
|
|
/**
|
* 工具类初始化异常
|
*/
|
class ToolBoxException extends RuntimeException {
|
private static final long serialVersionUID = 8247610319171014183L;
|
|
public ToolBoxException(Throwable e) {
|
super(e.getMessage(), e);
|
}
|
|
public ToolBoxException(String message) {
|
super(message);
|
}
|
|
public ToolBoxException(String messageTemplate, Object... params) {
|
super(StrKit.format(messageTemplate, params));
|
}
|
|
public ToolBoxException(String message, Throwable throwable) {
|
super(message, throwable);
|
}
|
|
public ToolBoxException(Throwable throwable, String messageTemplate, Object... params) {
|
super(StrKit.format(messageTemplate, params), throwable);
|
}
|
}
|
}
|