转换为字典格式
(self)
| 35 | self.suggestion = suggestion |
| 36 | |
| 37 | def to_dict(self) -> dict: |
| 38 | """转换为字典格式""" |
| 39 | error_dict = { |
| 40 | "code": self.code, |
| 41 | "message": self.message |
| 42 | } |
| 43 | if self.suggestion: |
| 44 | error_dict["suggestion"] = self.suggestion |
| 45 | return error_dict |
| 46 | |
| 47 | |
| 48 | class DataNotFoundError(MCPError): |
no outgoing calls
no test coverage detected