MCPcopy Create free account
hub / github.com/THUDM/AgentBench / ClientException

Class ClientException

src/typings/exception.py:8–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class ClientException(AgentBenchException):
9 def __init__(self, reason: str, detail: Union[str, None] = None) -> None:
10 super().__init__()
11 self.reason = reason
12 self.detail = detail
13
14 def __str__(self) -> str:
15 if not self.detail:
16 return "{CLASS_NAME}[{REASON}]".format(
17 CLASS_NAME=self.__class__.__name__, REASON=self.reason
18 )
19 else:
20 return "{CLASS_NAME}[{REASON}]: {DETAIL}".format(
21 CLASS_NAME=self.__class__.__name__,
22 REASON=self.reason,
23 DETAIL=self.detail,
24 )
25
26
27class ServerException(AgentBenchException):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected