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

  1. Read the embedded message — it's the upstream provider's actual error and dictates the fix
  2. For content-policy/moderation messages, adjust the prompt
  3. For token/rate errors, reduce max_tokens or retry with backoff
  4. 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

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


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