{"record":{"id":"ec0eb4c95951a92d","repo":"continuedev/continue","slug":"await-resp-text-ec0eb4","errorCode":null,"errorMessage":"await resp.text()","messagePattern":"await resp\\.text\\(\\)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/llm/llms/NCompass.ts","lineNumber":58,"sourceCode":"    return headers;\n  }\n\n  protected async _embed(chunks: string[]): Promise<number[][]> {\n    const resp = await this.fetch(NCompass.embeddingsApiEndpoint, {\n      method: \"POST\",\n      body: JSON.stringify({\n        input: chunks,\n        model: this.model,\n        ...this.extraBodyProperties(),\n      }),\n      headers: {\n        Authorization: `Bearer ${this.apiKey}`,\n        \"Content-Type\": \"application/json\",\n      },\n    });\n\n    if (!resp.ok) {\n      throw new Error(await resp.text());\n    }\n\n    const data = (await resp.json()) as any;\n    return data.data.map((result: { embedding: number[] }) => result.embedding);\n  }\n}\n\nexport default NCompass;\n","sourceCodeStart":40,"sourceCodeEnd":67,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/llm/llms/NCompass.ts#L40-L67","documentation":"Thrown by NCompass._embed when the NCompass embedding API responds with a non-2xx status; the raw response body becomes the error message. NCompass is NVIDIA's NIM-style endpoint, so failures usually trace back to the Authorization bearer token or the endpoint URL.","triggerScenarios":"Calling embeddings with provider ncompass where the POST fails: invalid/expired apiKey, endpoint not yet provisioned, or malformed request JSON.","commonSituations":"Expired NVIDIA API token, wrong nvidiaApiBase, or calling an embedding model the key doesn't have access to.","solutions":["Inspect the body text for 401/403 (regenerate apiKey) vs 404 (fix base URL/model name)","Regenerate the NCompass/NVIDIA API key and update config.json","Verify the model name and that the endpoint is provisioned in your account"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"null","typeGuard":"function isAuthError(e: unknown): boolean { return e instanceof Error && /401|403|unauthorized|forbidden/i.test(e.message); }","tryCatchPattern":"for (let attempt = 0; attempt < 3; attempt++) {\n  try { return await llm.embed(chunks); }\n  catch (e) { if (isAuthError(e)) throw e; await sleep(2 ** attempt * 500); }\n}","preventionTips":["Rotate NCompass API keys before expiry","Verify endpoint provisioning after account changes"],"tags":["ncompass","nvidia","embedding","api-key","http-error"],"backgroundTag":"rest-api-error-response","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}