{"record":{"id":"651b4d7029344081","repo":"BerriAI/litellm","slug":"e-response-text-if-e-response-else-str-e","errorCode":null,"errorMessage":"e.response.text if e.response else str(e)","messagePattern":"e\\.response\\.text if e\\.response else str\\(e\\)","errorType":"http","errorClass":"OpenAILikeError","httpStatus":null,"severity":"error","filePath":"litellm/llms/openai_like/embedding/handler.py","lineNumber":57,"sourceCode":"            if client is None or not isinstance(client, AsyncHTTPHandler):\n                async_client = get_async_httpx_client(\n                    llm_provider=litellm.LlmProviders.OPENAI,\n                    params={\"timeout\": timeout},\n                )\n            else:\n                async_client = client\n            try:\n                response = await async_client.post(\n                    api_base,\n                    headers=headers,\n                    data=json.dumps(data),\n                )\n\n                response.raise_for_status()\n\n                response_json: Final = response.json()\n            except httpx.HTTPStatusError as e:\n                raise OpenAILikeError(\n                    status_code=e.response.status_code,\n                    message=e.response.text if e.response else str(e),\n                )\n            except httpx.TimeoutException:\n                raise OpenAILikeError(status_code=408, message=\"Timeout error occurred.\")\n            except Exception as e:\n                raise OpenAILikeError(status_code=500, message=str(e))\n\n            ## LOGGING\n            logging_obj.post_call(\n                input=input,\n                api_key=api_key,\n                additional_args={\"complete_input_dict\": data},\n                original_response=response_json,\n            )\n            return EmbeddingResponse(**response_json)\n        except Exception as e:\n            ## LOGGING","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/openai_like/embedding/handler.py#L39-L75","documentation":"Error-mapping branch for the OpenAI-like async embedding call: the POST returned an HTTP error, and the message uses the response body text when a response object exists, otherwise the exception's string form (e.g. connection refused before a response).","triggerScenarios":"Thrown at litellm/llms/openai_like/embedding/handler.py:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the HTTP error body in the message; fix credentials or embedding request payload."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}