mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
Merge ff840c162a
into b82af5b826
This commit is contained in:
commit
29c4656e32
2 changed files with 8 additions and 7 deletions
|
@ -36,7 +36,10 @@ class JsonFormatter(Formatter):
|
|||
}
|
||||
|
||||
if record.exc_info:
|
||||
json_record["stacktrace"] = self.formatException(record.exc_info)
|
||||
try:
|
||||
json_record["stacktrace"] = self.formatException(record.exc_info)
|
||||
except Exception as e:
|
||||
json_record["stacktrace"] = f"Error serializing stacktrace: {str(e)}"
|
||||
|
||||
return json.dumps(json_record)
|
||||
|
||||
|
|
|
@ -4,14 +4,12 @@ import httpx
|
|||
|
||||
|
||||
class OpenAILikeError(Exception):
|
||||
def __init__(self, status_code, message):
|
||||
def __init__(self, status_code, message, request: Optional[httpx.Request] = None, response: Optional[httpx.Response] = None):
|
||||
self.status_code = status_code
|
||||
self.message = message
|
||||
self.request = httpx.Request(method="POST", url="https://www.litellm.ai")
|
||||
self.response = httpx.Response(status_code=status_code, request=self.request)
|
||||
super().__init__(
|
||||
self.message
|
||||
) # Call the base class constructor with the parameters it needs
|
||||
self.request = request
|
||||
self.response = response
|
||||
super().__init__(message) # Call the base class constructor with the parameters it needs
|
||||
|
||||
|
||||
class OpenAILikeBase:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue