This commit is contained in:
Typer_Body
2026-06-07 02:17:40 +08:00
parent af451e7006
commit 0c6f71738c
11 changed files with 1138 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
from __future__ import annotations
class DeerFlowAPIError(Exception):
"""DeerFlow API 请求失败"""
def __init__(
self,
*,
operation: str = '',
status: int = 0,
body: str = '',
url: str = '',
thread_id: str | None = None,
message: str = '',
) -> None:
self.operation = operation
self.status = status
self.body = body
self.url = url
self.thread_id = thread_id
if message:
super().__init__(message)
return
msg = f'DeerFlow {operation} failed: status={status}, url={url}, body={body}'
if thread_id is not None:
msg = (
f'DeerFlow {operation} failed: thread_id={thread_id}, '
f'status={status}, url={url}, body={body}'
)
super().__init__(msg)