package cn.stylefeng.workflow.api.exception;

import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import cn.stylefeng.workflow.api.constants.WorkflowConstants;

public class WorkflowException extends ServiceException {

    public WorkflowException(AbstractExceptionEnum exception, Object... params) {
        super(WorkflowConstants.WORKFLOW_MODULE_NAME, exception.getErrorCode(), StrUtil.format(exception.getUserTip(), params));
    }

    public WorkflowException(AbstractExceptionEnum exception) {
        super(WorkflowConstants.WORKFLOW_MODULE_NAME, exception);
    }

}
