{"record":{"id":"ed2ff1511a2c4492","repo":"BerriAI/litellm","slug":"error-parsing-initial-response-e","errorCode":null,"errorMessage":"Error parsing initial response: {e}","messagePattern":"Error parsing initial response: (.+?)","errorType":"exception","errorClass":"BlackForestLabsError","httpStatus":null,"severity":"error","filePath":"litellm/llms/black_forest_labs/image_edit/handler.py","lineNumber":316,"sourceCode":"            max_wait: Maximum time to wait in seconds\n            interval: Polling interval in seconds\n            timeout: Timeout for each individual polling request\n\n        Returns:\n            Final response with completed result\n        \"\"\"\n        # Validate initial response status code\n        if initial_response.status_code >= 400:\n            raise BlackForestLabsError(\n                status_code=initial_response.status_code,\n                message=f\"BFL initial request failed: {initial_response.text}\",\n            )\n\n        # Parse initial response to get polling URL\n        try:\n            response_data: Final = initial_response.json()\n        except Exception as e:\n            raise BlackForestLabsError(\n                status_code=initial_response.status_code,\n                message=f\"Error parsing initial response: {e}\",\n            )\n\n        # Check for immediate errors\n        if \"errors\" in response_data:\n            raise BlackForestLabsError(\n                status_code=initial_response.status_code,\n                message=f\"BFL error: {response_data['errors']}\",\n            )\n\n        polling_url: Final = response_data.get(\"polling_url\")\n        if not polling_url:\n            raise BlackForestLabsError(\n                status_code=500,\n                message=\"No polling_url in BFL response\",\n            )\n","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/black_forest_labs/image_edit/handler.py#L298-L334","documentation":"Error \"Error parsing initial response: {e}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The BFL response was not valid JSON; check the API status."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}