continuedev/continue · error · Error
Error streaming response: ${JSON.stringify(data.error)}
Error message
Error streaming response: ${JSON.stringify(data.error)} What it means
Same as the message variant: the streamed data line contained an error object without a 'message' property, so the whole error is JSON.stringify'd into the exception text.
Source
Thrown at packages/fetch/src/stream.ts:92
// 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
- Log the stringified error to identify the upstream shape
- Match on /^Error streaming response:/ in catch blocks regardless of which variant threw
- Fix the upstream/proxy producing non-standard error payloads
- Retry if the stringified error indicates transient conditions
Defensive patterns
Strategy: try-catch
Try / catch
catch (e) { if (/^Error streaming response:/.test(e.message)) { const payload = e.message.replace(/^Error streaming response: /, ''); const parsed = JSON.parse(payload); /* non-standard error shape */ } } Prevention
- Don't assume error.message is the provider text — it may be JSON
- Log raw in-stream errors to identify non-standard upstream shapes
- Test against your actual provider's error payloads
When it happens
Trigger: Stream data line has {error: ...} where error is not an object with 'message' (string, array, or object without message).
Common situations: Non-standard provider error payloads, proxies returning {error: 'gateway timeout'}, or partial JSON error shapes.
Related errors
- Error streaming response: ${data.error.message}
- 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/523bd859db7064ca.
Report an issue: GitHub.