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.

51 lines
990 B
Java

package com.ils.oms.result;
/**
*
* @describe 全局异常处理类
* @author chenjf
* @since 2023/8/8
*/
public class GlobalException extends Exception{
private String code;
private String message;
public GlobalException() {
super();
}
public GlobalException(String message) {
super(message);
this.message = message;
}
public GlobalException(String code, String message) {
super(code + ": " + message);
this.code = code;
this.message = message;
}
public GlobalException(String message, Throwable throwable) {
super(message, throwable);
this.message = message;
}
public GlobalException(Throwable throwable) {
super(throwable);
}
public String getCode() {
return code;
}
@Override
public String getMessage() {
return message;
}
@Override
public String toString() {
return code + ": " + message;
}
}