2024-04-08 10:51:46 +00:00
|
|
|
from core.tools.entities.tool_entities import ToolInvokeMeta
|
2026-02-09 06:57:23 +00:00
|
|
|
from libs.exception import BaseHTTPException
|
2024-04-08 10:51:46 +00:00
|
|
|
|
|
|
|
|
|
2024-01-23 11:58:23 +00:00
|
|
|
class ToolProviderNotFoundError(ValueError):
|
|
|
|
|
pass
|
|
|
|
|
|
2024-09-10 09:00:20 +00:00
|
|
|
|
2024-01-23 11:58:23 +00:00
|
|
|
class ToolNotFoundError(ValueError):
|
|
|
|
|
pass
|
|
|
|
|
|
2024-09-10 09:00:20 +00:00
|
|
|
|
2024-01-31 03:58:07 +00:00
|
|
|
class ToolParameterValidationError(ValueError):
|
2024-01-23 11:58:23 +00:00
|
|
|
pass
|
|
|
|
|
|
2024-09-10 09:00:20 +00:00
|
|
|
|
2024-01-23 11:58:23 +00:00
|
|
|
class ToolProviderCredentialValidationError(ValueError):
|
|
|
|
|
pass
|
|
|
|
|
|
2024-09-10 09:00:20 +00:00
|
|
|
|
2024-01-23 11:58:23 +00:00
|
|
|
class ToolNotSupportedError(ValueError):
|
|
|
|
|
pass
|
|
|
|
|
|
2024-09-10 09:00:20 +00:00
|
|
|
|
2024-01-23 11:58:23 +00:00
|
|
|
class ToolInvokeError(ValueError):
|
|
|
|
|
pass
|
|
|
|
|
|
2024-09-10 09:00:20 +00:00
|
|
|
|
2024-01-23 11:58:23 +00:00
|
|
|
class ToolApiSchemaError(ValueError):
|
2024-04-08 10:51:46 +00:00
|
|
|
pass
|
|
|
|
|
|
2024-09-10 09:00:20 +00:00
|
|
|
|
2025-12-15 08:28:25 +00:00
|
|
|
class ToolSSRFError(ValueError):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
2025-09-09 06:45:05 +00:00
|
|
|
class ToolCredentialPolicyViolationError(ValueError):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
2026-02-09 06:57:23 +00:00
|
|
|
class WorkflowToolHumanInputNotSupportedError(BaseHTTPException):
|
|
|
|
|
error_code = "workflow_tool_human_input_not_supported"
|
|
|
|
|
description = "Workflow with Human Input nodes cannot be published as a workflow tool."
|
|
|
|
|
code = 400
|
|
|
|
|
|
|
|
|
|
|
2024-04-08 10:51:46 +00:00
|
|
|
class ToolEngineInvokeError(Exception):
|
2024-09-10 09:00:20 +00:00
|
|
|
meta: ToolInvokeMeta
|
2024-12-31 06:01:24 +00:00
|
|
|
|
|
|
|
|
def __init__(self, meta, **kwargs):
|
|
|
|
|
self.meta = meta
|
|
|
|
|
super().__init__(**kwargs)
|