continuedev/continue · error · Error

Error in BedrockReranker.rerank: Unknown error occurred

Error message

Error in BedrockReranker.rerank: Unknown error occurred

What it means

Thrown when BedrockReranker.rerank catches a non-Error value (string throw, object rejection, symbol) from the AWS call. The original thrown value is discarded entirely, making this the least informative failure.

Source

Thrown at packages/openai-adapters/src/apis/Bedrock.ts:710

      return rerank({
        model: body.model,
        usage: {
          total_tokens: 0,
        },
        data: scores,
      });
    } catch (error) {
      if (error instanceof Error) {
        if ("code" in error) {
          // AWS SDK specific errors
          throw new Error(
            `AWS Bedrock rerank error (${(error as any).code}): ${error.message}`,
          );
        }
        throw new Error(`Error in BedrockReranker.rerank: ${error.message}`);
      }
      throw new Error(
        "Error in BedrockReranker.rerank: Unknown error occurred",
      );
    }
  }

  list(): Promise<Model[]> {
    throw new Error("Method not implemented.");
  }
}

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Reproduce with logging around the SDK call to capture the raw rejected value (catch (e) { console.error(typeof e, e); }).
  2. If caused by test mocks, make them reject with new Error(...) instead of strings.
  3. Update or pin the AWS SDK version if middleware is the culprit.
Defensive patterns

Strategy: try-catch

Try / catch

catch (e) { if (!(e instanceof Error)) { log.raw('non-error rejection', e); throw new Error(String(e)); } }

Prevention

When it happens

Trigger: A promise rejection with a plain object/string — e.g. an interceptor, mock, or SDK bug rejecting with a non-Error; serialization failures inside SDK middleware.

Common situations: Unit tests mocking the SDK with `throw 'oops'` instead of an Error; SDK middleware rejections; memory/serialization issues producing odd rejections.

Related errors


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