Update Js for logs.html

This commit is contained in:
XOF
2025-11-24 20:47:12 +08:00
parent f2706d6fc8
commit e026d8f324
23 changed files with 1884 additions and 396 deletions

View File

@@ -15,6 +15,7 @@ import (
type APIError struct {
HTTPStatus int
Code string
Status string `json:"status,omitempty"`
Message string
}
@@ -61,11 +62,13 @@ func NewAPIError(base *APIError, message string) *APIError {
}
// NewAPIErrorWithUpstream creates a new APIError specifically for wrapping raw upstream errors.
func NewAPIErrorWithUpstream(statusCode int, code string, upstreamMessage string) *APIError {
func NewAPIErrorWithUpstream(statusCode int, code string, bodyBytes []byte) *APIError {
msg, status := ParseUpstreamError(bodyBytes)
return &APIError{
HTTPStatus: statusCode,
Code: code,
Message: upstreamMessage,
Message: msg,
Status: status,
}
}