Merge pull request #3060 from chengzhichao-xydt/codex/error-wrap-and-marshal
fix: use %w for error wrapping and handle json.MarshalIndent error
This commit is contained in:
2 files changed
+5
-2
No files matched your search
@@ -2275,7 +2275,10 @@ func (t *WebFetchTool) Execute(ctx context.Context, args map[string]any) *ToolRe
|
||||
"text": text,
|
||||
}
|
||||
|
||||
resultJSON, _ := json.MarshalIndent(result, "", " ")
|
||||
resultJSON, marshalErr := json.MarshalIndent(result, "", " ")
|
||||
if marshalErr != nil {
|
||||
return ErrorResult(fmt.Sprintf("failed to marshal result: %v", marshalErr))
|
||||
}
|
||||
|
||||
return &ToolResult{
|
||||
ForLLM: string(resultJSON),
|
||||
|
||||
Reference in new issue
Block a user