continuedev/continue · error · Error
await resp.text()
Error message
await resp.text()
What it means
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.
Source
Thrown at core/llm/llms/NCompass.ts:58
return headers;
}
protected async _embed(chunks: string[]): Promise<number[][]> {
const resp = await this.fetch(NCompass.embeddingsApiEndpoint, {
method: "POST",
body: JSON.stringify({
input: chunks,
model: this.model,
...this.extraBodyProperties(),
}),
headers: {
Authorization: `Bearer ${this.apiKey}`,
"Content-Type": "application/json",
},
});
if (!resp.ok) {
throw new Error(await resp.text());
}
const data = (await resp.json()) as any;
return data.data.map((result: { embedding: number[] }) => result.embedding);
}
}
export default NCompass;
View on GitHub (pinned to 5522c6f44c)
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
Defensive patterns
Strategy: retry
Validate before calling
null
Type guard
function isAuthError(e: unknown): boolean { return e instanceof Error && /401|403|unauthorized|forbidden/i.test(e.message); } Try / catch
for (let attempt = 0; attempt < 3; attempt++) {
try { return await llm.embed(chunks); }
catch (e) { if (isAuthError(e)) throw e; await sleep(2 ** attempt * 500); }
} Prevention
- Rotate NCompass API keys before expiry
- Verify endpoint provisioning after account changes
When it happens
Trigger: Calling embeddings with provider ncompass where the POST fails: invalid/expired apiKey, endpoint not yet provisioned, or malformed request JSON.
Common situations: Expired NVIDIA API token, wrong nvidiaApiBase, or calling an embedding model the key doesn't have access to.
Related errors
- await resp.text()
- await resp.text()
- Failed to embed chunk: ${await resp.text()}
- Failed to parse config.json: ${e}
- Unsupported transport type: ${this.options.type}
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/ec0eb4c95951a92d.
Report an issue: GitHub.