mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
ollama client library: Include command output in the error message.
This helps debugging ollama-based tests. PiperOrigin-RevId: 597316714
This commit is contained in:
committed by
gVisor bot
parent
5b33e4a3d8
commit
99de8a774d
@@ -124,7 +124,13 @@ func (llm *Ollama) request(ctx context.Context, endpoint string, data []byte) ([
|
||||
Image: "basic/busybox",
|
||||
Links: []string{llm.container.MakeLink("llm")},
|
||||
}, cmd...)
|
||||
return []byte(out), err
|
||||
if err != nil {
|
||||
if out != "" {
|
||||
return []byte(out), fmt.Errorf("command %q failed (%w): %v", strings.Join(cmd, " "), err, out)
|
||||
}
|
||||
return nil, fmt.Errorf("could not run command %q: %w", strings.Join(cmd, " "), err)
|
||||
}
|
||||
return []byte(out), nil
|
||||
}
|
||||
|
||||
// jsonGet performs a JSON HTTP GET request.
|
||||
|
||||
Reference in New Issue
Block a user