AgentClaw Exception Definitions (agentclaw/exceptions.py)

gitingest_Negai-ai_AgentClaw · agentclaw/exceptions.py · python · Apache-2.0
ai, dev-tools, automation, lang:python, tag:knn-classified, tag:exceptions, tag:error-handling, tag:agentclaw

Defines the core exception hierarchy for AgentClaw, including workflow cancellation, timeout, node execution failures, and configuration errors, to standardize error handling across the library.

# Source: https://github.com/Negai-ai/AgentClaw | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations
from typing import Optional

class AgentClawError(Exception):
    """AgentClaw 基础异常"""
    pass

class WorkflowCancelledError(AgentClawError):
    """工作流被取消异常"""
    pass

class WorkflowTimeoutError(AgentClawError):
    """工作流超时异常"""
    pass

class NodeExecutionError(AgentClawError):
    """节点执行异常"""
    
    def __init__(self, node_id: str, message: str, original_error: Optional[Exception] = None):
        self.node_id = node_id
        self.original_error = original_error
        super().__init__(f"节点 '{node_id}' 执行失败: {message}"

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key