From 43e5890f778d7cebeaab58d983d599cfa7842d2d Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 19 Jul 2024 15:56:35 -0700 Subject: [PATCH] fix health check --- litellm/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/litellm/main.py b/litellm/main.py index 3889d1bc8..628349d09 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -4798,9 +4798,10 @@ async def ahealth_check( if isinstance(stack_trace, str): stack_trace = stack_trace[:1000] if model not in litellm.model_cost and mode is None: - raise Exception( - "Missing `mode`. Set the `mode` for the model - https://docs.litellm.ai/docs/proxy/health#embedding-models" - ) + return { + "error": "Missing `mode`. Set the `mode` for the model - https://docs.litellm.ai/docs/proxy/health#embedding-models" + } + error_to_return = str(e) + " stack trace: " + stack_trace return {"error": error_to_return}