Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/site/pages/en/learn/getting-started/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ async function streamOllamaCompletion(prompt) {
// You can read about HTTP status codes here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
// 200 means the request was successful.
if (statusCode !== 200) {
// consuming the response body is mandatory: https://undici.nodejs.org/#/?id=garbage-collection
await body.dump();
throw new Error(`Ollama request failed with status ${statusCode}`);
}

Expand Down
Loading