mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix(utils.py): log failure to sync failure callbacks as well
This commit is contained in:
parent
b1b21b0340
commit
fd11f63f71
2 changed files with 19 additions and 5 deletions
|
@ -7,6 +7,7 @@ import os
|
|||
import re
|
||||
import smtplib
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
import traceback
|
||||
from datetime import datetime, timedelta
|
||||
|
@ -583,6 +584,7 @@ class ProxyLogging:
|
|||
start_time=datetime.now(),
|
||||
**request_data,
|
||||
)
|
||||
|
||||
# log the custom exception
|
||||
await litellm_logging_obj.async_failure_handler(
|
||||
exception=original_exception,
|
||||
|
@ -591,6 +593,16 @@ class ProxyLogging:
|
|||
end_time=time.time(),
|
||||
)
|
||||
|
||||
threading.Thread(
|
||||
target=litellm_logging_obj.failure_handler,
|
||||
args=(
|
||||
original_exception,
|
||||
traceback.format_exc(),
|
||||
time.time(),
|
||||
time.time(),
|
||||
),
|
||||
).start()
|
||||
|
||||
for callback in litellm.callbacks:
|
||||
try:
|
||||
_callback: Optional[CustomLogger] = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue