package com.easyagents.agent.runtime.hitl;

import com.easyagents.agent.runtime.AgentRuntimeException;

/**
 * 工具审批被拒绝时抛出的异常。
 */
public class AgentToolApprovalRejectedException extends AgentRuntimeException {

    private final String rejectReason;

    /**
     * 创建工具审批拒绝异常。
     *
     * @param rejectReason 拒绝原因
     */
    public AgentToolApprovalRejectedException(String rejectReason) {
        super(rejectReason == null || rejectReason.isBlank() ? "工具执行已被拒绝。" : rejectReason);
        this.rejectReason = rejectReason;
    }

    /**
     * 获取拒绝原因。
     *
     * @return 拒绝原因
     */
    public String getRejectReason() {
        return rejectReason;
    }
}
