{"record":{"id":"46bf1b80439d00ad","repo":"Comfy-Org/ComfyUI","slug":"openrouter-error-code-response-error-message","errorCode":null,"errorMessage":"OpenRouter error ({code}): {response.error.message or 'no message'}","messagePattern":"OpenRouter error \\((.+?)\\): (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_openrouter.py","lineNumber":257,"sourceCode":"        web_search_options=web_search_cfg,\n    )\n\n\ndef _extract_text(response: OpenRouterChatResponse) -> str:\n    if response.error:\n        code = response.error.code if response.error.code is not None else \"unknown\"\n        raise ValueError(f\"OpenRouter error ({code}): {response.error.message or 'no message'}\")\n    if not response.choices:\n        raise ValueError(\"Empty response from OpenRouter (no choices).\")\n    message = response.choices[0].message","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_openrouter.py#L239-L275","documentation":"Error \"OpenRouter error ({code}): {response.error.message or 'no message'}\" thrown in Comfy-Org/ComfyUI.","triggerScenarios":"Thrown at comfy_api_nodes/nodes_openrouter.py:257 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the OpenRouter error code and message and adjust the request."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}