forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexc.py
More file actions
31 lines (23 loc) · 1.01 KB
/
Copy pathexc.py
File metadata and controls
31 lines (23 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Exceptions for CopilotKit."""
class ActionNotFoundException(Exception):
"""Exception raised when an action or agent is not found."""
def __init__(self, name: str):
self.name = name
super().__init__(f"Action '{name}' not found.")
class AgentNotFoundException(Exception):
"""Exception raised when an agent is not found."""
def __init__(self, name: str):
self.name = name
super().__init__(f"Agent '{name}' not found.")
class ActionExecutionException(Exception):
"""Exception raised when an action fails to execute."""
def __init__(self, name: str, error: Exception):
self.name = name
self.error = error
super().__init__(f"Action '{name}' failed to execute: {error}")
class AgentExecutionException(Exception):
"""Exception raised when an agent fails to execute."""
def __init__(self, name: str, error: Exception):
self.name = name
self.error = error
super().__init__(f"Agent '{name}' failed to execute: {error}")