continuedev/continue · error · Error
Error processing Bedrock stream: Unknown error occurred
Error message
Error processing Bedrock stream: Unknown error occurred
What it means
Defensive fallback in chatCompletionStream's catch block: something was thrown that is not an instance of Error (e.g. a string, plain object, or a rejected non-Error promise). Because there is no message to surface, the adapter throws this generic 'Unknown error occurred' error. It almost always indicates an unexpected bug in the stream pipeline rather than a Bedrock service problem.
Source
Thrown at packages/openai-adapters/src/apis/Bedrock.ts:568
arguments: undefined,
},
},
],
},
});
}
}
}
} catch (error) {
if (error instanceof Error) {
if ("code" in error) {
throw new Error(
`AWS Bedrock stream error (${(error as any).code}): ${error.message}`,
);
}
throw new Error(`Error processing Bedrock stream: ${error.message}`);
}
throw new Error(
"Error processing Bedrock stream: Unknown error occurred",
);
}
}
completionNonStream(
body: CompletionCreateParamsNonStreaming,
): Promise<Completion> {
throw new Error("Bedrock does not support completions API");
}
completionStream(
body: CompletionCreateParamsStreaming,
): AsyncGenerator<Completion> {
throw new Error("Bedrock does not support completions API");
}
fimStream(View on GitHub (pinned to 5522c6f44c)
Solutions
- Reproduce with logging around the call to capture what was actually thrown (console.log the caught value before it's wrapped).
- Wrap the streaming call and inspect `e.cause` or log the raw rejection to identify the non-Error source.
- Update openai-adapters and AWS SDK v3 dependencies — known non-Error throw paths get fixed over time.
- If your own code intercepts the stream (custom fetch), ensure it only rejects with Error instances.
Defensive patterns
Strategy: try-catch
Try / catch
try {
await api.chatCompletionStream(body);
} catch (e) {
if (e instanceof Error && e.message === 'Error processing Bedrock stream: Unknown error occurred') {
// non-Error thrown upstream — log and report as adapter/dependency bug
logger.error('Non-Error rejection from Bedrock stream pipeline');
}
throw e;
} Prevention
- Ensure any custom fetch/transport wrappers reject only with Error instances.
- Pin dependency versions to avoid SDK behavior drift.
- Capture and log the raw thrown value when this occurs to find the source.
When it happens
Trigger: A promise inside the stream loop rejects with a non-Error value (string throw, plain object, undefined); an AWS SDK middleware or third-party lib throws a non-Error; internal code does `throw 'some string'`.
Common situations: Custom fetch/axios wrappers that reject with strings or response objects; older dependencies that throw non-Error values; adapter bugs after an upstream format change.
Related errors
- Error in BedrockReranker.rerank: Unknown error occurred
- Malformed JSON received from Bedrock: ${decoded}
- No stream received from Bedrock API
- AWS Bedrock stream error (${(error as any).code}): ${error.m
- Error processing Bedrock stream: ${error.message}
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/004388905ddac927.
Report an issue: GitHub.