mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 10:23:14 +00:00
Update exception handling in tool_error_handler.py
Refine exception handling in tool error handler to capture specific exceptions.
This commit is contained in:
parent
770fcd4e1d
commit
bfaf361f25
1 changed files with 2 additions and 2 deletions
|
|
@ -78,7 +78,7 @@ class ToolErrorMiddleware(AgentMiddleware):
|
|||
) -> ToolMessage | Command:
|
||||
try:
|
||||
return handler(request)
|
||||
except:
|
||||
except Exception as e:
|
||||
logger.exception("Error during tool call handling; request=%r", request)
|
||||
data = _to_error_payload(e, request)
|
||||
return ToolMessage(
|
||||
|
|
@ -94,7 +94,7 @@ class ToolErrorMiddleware(AgentMiddleware):
|
|||
) -> ToolMessage | Command:
|
||||
try:
|
||||
return await handler(request)
|
||||
except:
|
||||
except Exception as e:
|
||||
logger.exception("Error during tool call handling; request=%r", request)
|
||||
data = _to_error_payload(e, request)
|
||||
return ToolMessage(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue