mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(utils.py): fix exception_mapping check for errors
If exception already mapped - don't attach traceback to it
This commit is contained in:
parent
70a605b3cc
commit
123477b55a
2 changed files with 9 additions and 11 deletions
|
@ -9,10 +9,11 @@
|
|||
|
||||
## LiteLLM versions of the OpenAI Exception Types
|
||||
|
||||
import openai
|
||||
import httpx
|
||||
from typing import Optional
|
||||
|
||||
import httpx
|
||||
import openai
|
||||
|
||||
|
||||
class AuthenticationError(openai.AuthenticationError): # type: ignore
|
||||
def __init__(
|
||||
|
@ -658,15 +659,8 @@ class APIResponseValidationError(openai.APIResponseValidationError): # type: ig
|
|||
|
||||
|
||||
class OpenAIError(openai.OpenAIError): # type: ignore
|
||||
def __init__(self, original_exception):
|
||||
self.status_code = original_exception.http_status
|
||||
super().__init__(
|
||||
http_body=original_exception.http_body,
|
||||
http_status=original_exception.http_status,
|
||||
json_body=original_exception.json_body,
|
||||
headers=original_exception.headers,
|
||||
code=original_exception.code,
|
||||
)
|
||||
def __init__(self, original_exception=None):
|
||||
super().__init__()
|
||||
self.llm_provider = "openai"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue