bug #I631ZF groovy脚本接入时,自定义异常抛出后被组件失败异常覆盖

This commit is contained in:
everywhere.z
2022-11-30 16:25:08 +08:00
parent 8286bf7eae
commit 2bd8e0a86b
8 changed files with 100 additions and 4 deletions

View File

@@ -100,7 +100,6 @@ public class GraalJavaScriptExecutor implements ScriptExecutor {
}
return value;
} catch (Exception e){
log.error(e.getMessage(), e);
throw e;
}
}

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.yomahub.liteflow.exception.LiteFlowException;
import com.yomahub.liteflow.script.ScriptBeanManager;
import com.yomahub.liteflow.script.ScriptExecuteWrap;
import com.yomahub.liteflow.slot.DataBus;
@@ -92,8 +93,11 @@ public class GroovyScriptExecutor implements ScriptExecutor {
return compiledScript.eval(bindings);
}catch (Exception e){
log.error(e.getMessage(), e);
throw e;
if (ObjectUtil.isNotNull(e.getCause()) && e.getCause() instanceof LiteFlowException){
throw (LiteFlowException)e.getCause();
}else{
throw e;
}
}
}

View File

@@ -91,7 +91,6 @@ public class JavaScriptExecutor implements ScriptExecutor {
return compiledScript.eval(bindings);
}catch (Exception e){
log.error(e.getMessage(), e);
throw e;
}
}