We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fbb9f6 commit 30d6c52Copy full SHA for 30d6c52
apps/site/pages/en/learn/getting-started/fetch.md
@@ -104,6 +104,8 @@ async function streamOllamaCompletion(prompt) {
104
// You can read about HTTP status codes here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
105
// 200 means the request was successful.
106
if (statusCode !== 200) {
107
+ // consuming the response body is mandatory: https://undici.nodejs.org/#/?id=garbage-collection
108
+ await body.dump();
109
throw new Error(`Ollama request failed with status ${statusCode}`);
110
}
111
0 commit comments