mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 10:23:14 +00:00
feat: add error normalization middleware for tool and model calls []Closes #904]
This commit is contained in:
parent
7413befa79
commit
03744fbf2d
2 changed files with 2 additions and 4 deletions
|
|
@ -45,9 +45,7 @@ def _extract_tool_name(request: ToolCallRequest | None) -> str | None:
|
|||
return None
|
||||
|
||||
|
||||
def _to_error_payload(
|
||||
e: Exception, request: ToolCallRequest | None = None
|
||||
) -> dict[str, str]:
|
||||
def _to_error_payload(e: Exception, request: ToolCallRequest | None = None) -> dict[str, str]:
|
||||
data: dict[str, str] = {
|
||||
"error": str(e),
|
||||
"error_type": e.__class__.__name__,
|
||||
|
|
|
|||
|
|
@ -91,4 +91,4 @@ def commit_and_open_pr(
|
|||
"title": title,
|
||||
"body": body,
|
||||
"commit_message": commit_message or title,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue