mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 02:16:36 +02:00
fix stream errors
This commit is contained in:
parent
00aaa05901
commit
1f27d7f1b8
3 changed files with 13 additions and 15 deletions
|
@ -131,6 +131,10 @@ func (c *Client) stream(ctx context.Context, method, path string, data any, fn f
|
|||
return fmt.Errorf("unmarshal: %w", err)
|
||||
}
|
||||
|
||||
if errorResponse.Error != "" {
|
||||
return fmt.Errorf("stream: %s", errorResponse.Error)
|
||||
}
|
||||
|
||||
if response.StatusCode >= 400 {
|
||||
return StatusError{
|
||||
StatusCode: response.StatusCode,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue