Merge branch 'main' into litellm_svc_logger

This commit is contained in:
Ishaan Jaff 2024-06-07 14:01:54 -07:00 committed by GitHub
commit 2cf3133669
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
84 changed files with 3848 additions and 5302 deletions

View file

@ -2889,3 +2889,16 @@ missing_keys_html_form = """
def _to_ns(dt):
return int(dt.timestamp() * 1e9)
def get_error_message_str(e: Exception) -> str:
error_message = ""
if isinstance(e, HTTPException):
if isinstance(e.detail, str):
error_message = e.detail
elif isinstance(e.detail, dict):
error_message = json.dumps(e.detail)
else:
error_message = str(e)
else:
error_message = str(e)
return error_message