feat(REQ-4196) - 调整 workflowEngineException 的构造器,支持传入 Throwable

This commit is contained in:
wangli 2025-05-19 16:52:32 +08:00
parent 3b2b77d732
commit 52506df1ef
2 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,11 @@ public class WorkflowEngineException extends ServiceException {
this.code = code.getRespCode();
}
public WorkflowEngineException(IRespCode code, Throwable cause, String... params) {
super(doFormat(code.getCode(), code.getMessage(), params), cause);
this.code = code.getRespCode();
}
@Override
public String getCode() {
return this.code;

View File

@ -27,7 +27,7 @@ public abstract class AbstractCommand<T> implements Command<T> {
throw e;
} catch (Exception e) {
log.warn(e.getMessage(), e);
throw new WorkflowEngineException(ENGINE_EXEC_EXCEPTION, e.getMessage());
throw new WorkflowEngineException(ENGINE_EXEC_EXCEPTION, e, e.getMessage());
}
}