forked from phoenix/litellm-mirror
fix(azure.py,-openai.py): raise the correct exceptions for image generation calls
This commit is contained in:
parent
cd350ab8d8
commit
be1e101b5f
2 changed files with 7 additions and 3 deletions
|
@ -702,7 +702,9 @@ class AzureChatCompletion(BaseLLM):
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
raise e
|
raise e
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if exception_mapping_worked:
|
if hasattr(e, "status_code"):
|
||||||
|
raise e
|
||||||
|
elif exception_mapping_worked:
|
||||||
raise e
|
raise e
|
||||||
else:
|
else:
|
||||||
import traceback
|
import traceback
|
||||||
|
|
|
@ -716,12 +716,14 @@ class OpenAIChatCompletion(BaseLLM):
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
raise e
|
raise e
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if exception_mapping_worked:
|
if hasattr(e, "status_code"):
|
||||||
|
raise e
|
||||||
|
elif exception_mapping_worked:
|
||||||
raise e
|
raise e
|
||||||
else:
|
else:
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
raise OpenAIError(status_code=500, message=traceback.format_exc())
|
raise AzureOpenAIError(status_code=500, message=traceback.format_exc())
|
||||||
|
|
||||||
async def ahealth_check(
|
async def ahealth_check(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue