com.gccloud.starter.common.exception.GlobalException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gc-starter-common Show documentation
Show all versions of gc-starter-common Show documentation
几乎所有的模块都依赖该模块,该模块中引入了一些常用工具类、通用的bean、全局异常处理、常量定义等
package com.gccloud.starter.common.exception;
import com.gccloud.starter.common.constant.GlobalConst;
import lombok.Data;
/**
* @author liuchengbiao
* @date 2020-06-12 16:11
*/
@Data
public class GlobalException extends RuntimeException {
private int code = GlobalConst.Response.Code.SERVER_ERROR;
public GlobalException(String msg) {
super(msg);
}
public GlobalException(String msg, Throwable e) {
super(msg, e);
}
public GlobalException(String msg, int code) {
super(msg);
this.setCode(code);
}
public GlobalException(String msg, int code, Throwable e) {
super(msg, e);
this.setCode(code);
}
}