test_get_error_information

This commit is contained in:
Ishaan Jaff 2025-02-28 16:13:15 -08:00
parent d27929b774
commit 9661191202
5 changed files with 4 additions and 6 deletions

View file

@ -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 "",
)

View file

@ -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]

View file

@ -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():

View file

@ -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;
};
}

View file

@ -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>