forked from phoenix/litellm-mirror
fix(slack_alerting.py): support region based outage alerting
This commit is contained in:
parent
18f8287e29
commit
f8350b9461
5 changed files with 309 additions and 61 deletions
|
@ -420,6 +420,8 @@ def mock_completion(
|
|||
api_key="mock-key",
|
||||
)
|
||||
if isinstance(mock_response, Exception):
|
||||
if isinstance(mock_response, openai.APIError):
|
||||
raise mock_response
|
||||
raise litellm.APIError(
|
||||
status_code=500, # type: ignore
|
||||
message=str(mock_response),
|
||||
|
@ -463,7 +465,9 @@ def mock_completion(
|
|||
|
||||
return model_response
|
||||
|
||||
except:
|
||||
except Exception as e:
|
||||
if isinstance(e, openai.APIError):
|
||||
raise e
|
||||
traceback.print_exc()
|
||||
raise Exception("Mock completion response failed")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue