mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
test_get_error_information
This commit is contained in:
parent
d27929b774
commit
9661191202
5 changed files with 4 additions and 6 deletions
|
|
@ -3133,7 +3133,6 @@ class StandardLoggingPayloadSetup:
|
|||
error_class=error_class,
|
||||
llm_provider=_llm_provider_in_exception,
|
||||
traceback=traceback_info,
|
||||
status_code=getattr(original_exception, "status_code", None),
|
||||
error_message=error_message if original_exception else "",
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1607,7 +1607,6 @@ class StandardLoggingPayloadErrorInformation(TypedDict, total=False):
|
|||
error_class: Optional[str]
|
||||
llm_provider: Optional[str]
|
||||
traceback: Optional[str]
|
||||
status_code: Optional[int]
|
||||
error_message: Optional[str]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -413,6 +413,7 @@ def test_get_error_information():
|
|||
assert result["error_code"] == "429"
|
||||
assert result["error_class"] == "RateLimitError"
|
||||
assert result["llm_provider"] == "openai"
|
||||
assert result["error_message"] == "litellm.RateLimitError: Test error"
|
||||
|
||||
|
||||
def test_get_response_time():
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@ interface ErrorViewerProps {
|
|||
errorInfo: {
|
||||
error_class?: string;
|
||||
error_message?: string;
|
||||
status_code?: string | number;
|
||||
traceback?: string;
|
||||
llm_provider?: string;
|
||||
error_code?: string;
|
||||
error_code?: string | number;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -588,7 +588,7 @@ function RequestViewer({ row }: { row: Row<LogEntry> }) {
|
|||
error: {
|
||||
message: errorInfo.error_message || "An error occurred",
|
||||
type: errorInfo.error_class || "error",
|
||||
code: errorInfo.error_code || errorInfo.status_code || "unknown",
|
||||
code: errorInfo.error_code || "unknown",
|
||||
param: null
|
||||
}
|
||||
};
|
||||
|
|
@ -688,7 +688,7 @@ function RequestViewer({ row }: { row: Row<LogEntry> }) {
|
|||
Response
|
||||
{hasError && (
|
||||
<span className="ml-2 text-sm text-red-600">
|
||||
• HTTP code {errorInfo?.status_code || 400}
|
||||
• HTTP code {errorInfo?.error_code || 400}
|
||||
</span>
|
||||
)}
|
||||
</h3>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue