package com.vci.ubcs.starter.exception; // // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.vci.ubcs.starter.web.util.MessageUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.text.MessageFormat; public class VciBaseException extends RuntimeException { private Logger log = LoggerFactory.getLogger(this.getClass()); public static final String paramNull = "com.vci.base.paramNull"; public static final String fieldValueRepeat = "com.vci.base.fieldValueRepeat"; public static final String objectNotFoundInDb = "com.vci.base.objectNotFoundInDb"; public static final String tsNotEqual = "com.vci.base.tsNotEqual"; public static final String dateValueFormatError = "com.vci.base.dateValueForamtError"; public static final String notLogin = "com.vci.base.notLogin"; public static final String notRight = "com.vci.base.notRight"; public static final String notDataRight = "com.vci.base.notDataRight"; public static final String notUIRight = "com.vci.base.notUIRight"; public static final String connectCorbaFail = "com.vci.base.connectCorbaFail"; public static final String corbaNotConfig = "com.vci.base.corbaNotConfig "; private String code; private Object[] objs = new Object[0]; public VciBaseException(String code) { this.code = code; } public VciBaseException(String code, Object[] objs) { this.code = code; this.objs = objs; } public VciBaseException(String code, Object[] objs, Throwable e) { super(e); this.code = code; this.objs = objs; } public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public Object[] getObjs() { return this.objs; } public void setObjs(Object[] objs) { this.objs = objs; } public String getErrorMsg() { if (!(this instanceof VciBaseException) && !this.getClass().getSuperclass().equals(VciBaseException.class)) { return this instanceof Exception ? this.getMessage() : this.code; } else { if (StringUtils.isNotBlank(this.code)) { this.code = MessageUtils.get(this.code, this.objs); } this.code = MessageFormat.format(this.code, this.objs); return this.code; } } @Override public String getMessage() { return this.getCode() + "," + this.getErrorMsg(); } }