mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
bug #I4QOP6 when超时时抛出的错是NPT
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package com.yomahub.liteflow.entity.flow.parallel;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.yomahub.liteflow.exception.WhenTimeoutException;
|
||||
import com.yomahub.liteflow.property.LiteflowConfigGetter;
|
||||
|
||||
/**
|
||||
* 并行异步CompletableFuture里的值对象
|
||||
* @author Bryan.Zhang
|
||||
@@ -37,6 +41,11 @@ public class WhenFutureObj {
|
||||
result.setSuccess(false);
|
||||
result.setTimeout(true);
|
||||
result.setExecutorName(executorName);
|
||||
result.setEx(new WhenTimeoutException(
|
||||
StrUtil.format("Timed out when executing the component[{}],when-max-timeout-seconds config is:{}(s)",
|
||||
executorName,
|
||||
LiteflowConfigGetter.get().getWhenMaxWaitSeconds()))
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yomahub.liteflow.exception;
|
||||
|
||||
|
||||
public class WhenTimeoutException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 异常信息 */
|
||||
private String message;
|
||||
|
||||
public WhenTimeoutException(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user