continuedev/continue · error · Error
Error streaming response: ${data.error.message}
Error message
Error streaming response: ${data.error.message} What it means
parseDataLine detected an error object in the streamed JSON payload (with a 'message' property) and rethrows it as an Error streaming response error, surfacing the server-side error message from inside the stream.
Source
Thrown at packages/fetch/src/stream.ts:90
}
}
// Export for testing purposes
export function parseDataLine(line: string): any {
const json = line.startsWith("data: ")
? line.slice("data: ".length)
: line.slice("data:".length);
try {
const data = JSON.parse(json);
if (data.error) {
if (
data.error &&
typeof data.error === "object" &&
"message" in data.error
) {
console.error("Error in streamed response:", data.error);
throw new Error(`Error streaming response: ${data.error.message}`);
}
throw new Error(
`Error streaming response: ${JSON.stringify(data.error)}`,
);
}
return data;
} catch (e) {
// If the error was thrown by our error check, rethrow it
if (
e instanceof Error &&
e.message.startsWith("Error streaming response:")
) {
throw e;
}
// Otherwise it's a JSON parsing error
throw new Error(`Malformed JSON sent from server: ${json}`);
}View on GitHub (pinned to 5522c6f44c)
Solutions
- Read the embedded message — it's the upstream provider's actual error and dictates the fix
- For content-policy/moderation messages, adjust the prompt
- For token/rate errors, reduce max_tokens or retry with backoff
- Handle per-stream errors so one failed stream doesn't kill the app
Defensive patterns
Strategy: try-catch
Try / catch
try { for await (const c of streamSse(response)) {} } catch (e) { if (e.message.startsWith('Error streaming response:')) { /* provider error inside stream; show message */ } else throw e; } Prevention
- Match on the 'Error streaming response:' prefix to distinguish in-stream errors from transport errors
- Surface provider messages (moderation, limits) to users
- Retry only when the embedded message indicates transient failure
When it happens
Trigger: SSE/JSON stream returns 200 but individual data lines contain {error: {message: ...}} — e.g. provider auth failure or content policy hit occurring after headers were sent.
Common situations: LLM APIs that start streaming then fail per-chunk (moderation triggers, token limits, upstream provider errors).
Related errors
- Error streaming response: ${JSON.stringify(data.error)}
- Malformed JSON sent from server: ${json}
- non-200 response body: ${await response.text()}
- No response body returned.
- Stream was closed before any data was received. Try again. (
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/8e54d8be06aa35a7.
Report an issue: GitHub.