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

  1. Log the stringified error to identify the upstream shape
  2. Match on /^Error streaming response:/ in catch blocks regardless of which variant threw
  3. Fix the upstream/proxy producing non-standard error payloads
  4. 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

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


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/523bd859db7064ca. Report an issue: GitHub.