com.fastchar.extjs.systemtool.provider.FastExceptionProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastchar-extjs-systemtool Show documentation
Show all versions of fastchar-extjs-systemtool Show documentation
FastChar-ExtJs-SystemTool is a FastChar-ExtJs plugin.
The newest version!
package com.fastchar.extjs.systemtool.provider;
import com.fastchar.core.FastChar;
import com.fastchar.extjs.systemtool.FastSystemToolConfig;
import com.fastchar.extjs.systemtool.entity.FinalLogExceptionEntity;
import com.fastchar.interfaces.IFastException;
import com.fastchar.utils.FastStringUtils;
/**
* @author 沈建(Janesen)
* @date 2021/5/15 18:11
*/
public class FastExceptionProvider implements IFastException {
@Override
public boolean onPrintException(Throwable throwable) {
if (!FastChar.getConstant().isWebStarted()) {
return false;
}
if (FastChar.getConstant().isWebStopped()) {
return false;
}
FinalLogExceptionEntity exceptionEntity = FinalLogExceptionEntity.newInstance();
exceptionEntity.set("exception", FastStringUtils.toThrowableInfo(throwable));
if (exceptionEntity.save()) {
FinalLogExceptionEntity.dao().clearData(FastChar.getConfig(FastSystemToolConfig.class).getLogExceptionMaxKeepDay());
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy