{"record":{"id":"601fbe3ed6655d95","repo":"continuedev/continue","slug":"error-in-bedrockreranker-rerank-error-message-601fbe","errorCode":null,"errorMessage":"Error in BedrockReranker.rerank: ${error.message}","messagePattern":"Error in BedrockReranker\\.rerank: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/Bedrock.ts","lineNumber":708,"sourceCode":"        .sort((a: any, b: any) => a.index - b.index)\n        .map((result: any) => result.relevance_score);\n\n      return rerank({\n        model: body.model,\n        usage: {\n          total_tokens: 0,\n        },\n        data: scores,\n      });\n    } catch (error) {\n      if (error instanceof Error) {\n        if (\"code\" in error) {\n          // AWS SDK specific errors\n          throw new Error(\n            `AWS Bedrock rerank error (${(error as any).code}): ${error.message}`,\n          );\n        }\n        throw new Error(`Error in BedrockReranker.rerank: ${error.message}`);\n      }\n      throw new Error(\n        \"Error in BedrockReranker.rerank: Unknown error occurred\",\n      );\n    }\n  }\n\n  list(): Promise<Model[]> {\n    throw new Error(\"Method not implemented.\");\n  }\n}\n","sourceCodeStart":690,"sourceCodeEnd":720,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/Bedrock.ts#L690-L720","documentation":"Generic wrapper thrown by BedrockReranker.rerank for any non-AWS-coded Error that escapes the rerank HTTP call — network faults, JSON parse failures, or unexpected response shapes. Only the message string is preserved, so the AWS code is lost.","triggerScenarios":"DNS/TLS failure reaching bedrock-agent-runtime, proxy interference, truncated response body failing JSON.parse, or SDK throwing a plain Error without a code property.","commonSituations":"Corporate proxies breaking SDK requests; transient network drops; response schema drift after an SDK upgrade.","solutions":["Inspect error.message for the underlying cause; retry on transient network messages.","Verify network/proxy configuration for AWS endpoints.","Pin or update @aws-sdk/client-bedrock-agent-runtime if the response shape changed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await bedrock.rerank(body); } catch (e) { log.error('bedrock rerank failed', e instanceof Error ? e.message : e); await fallbackRerank(body); }","preventionTips":["Wrap rerank calls with a fallback (skip reranking or use another provider).","Log full error details to distinguish network vs AWS errors."],"tags":["bedrock","network","wrapper-error"],"backgroundTag":"network-request-failed","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}