{"record":{"id":"c9d113d289c91865","repo":"continuedev/continue","slug":"error-in-bedrockreranker-rerank-unknown-error-occ-c9d113","errorCode":null,"errorMessage":"Error in BedrockReranker.rerank: Unknown error occurred","messagePattern":"Error in BedrockReranker\\.rerank: Unknown error occurred","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/Bedrock.ts","lineNumber":710,"sourceCode":"\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":692,"sourceCodeEnd":720,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/Bedrock.ts#L692-L720","documentation":"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.","triggerScenarios":"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.","commonSituations":"Unit tests mocking the SDK with `throw 'oops'` instead of an Error; SDK middleware rejections; memory/serialization issues producing odd rejections.","solutions":["Reproduce with logging around the SDK call to capture the raw rejected value (catch (e) { console.error(typeof e, e); }).","If caused by test mocks, make them reject with new Error(...) instead of strings.","Update or pin the AWS SDK version if middleware is the culprit."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (!(e instanceof Error)) { log.raw('non-error rejection', e); throw new Error(String(e)); } }","preventionTips":["In tests, always reject with new Error(...) not strings.","Log raw rejected values when this opaque error appears."],"tags":["bedrock","unknown-error","non-error-throw"],"backgroundTag":"unknown-runtime-exception","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}