fix(relay):余额不足不应该出现报错日志
This commit is contained in:
1 parent
dc55125f6e
commit
78cfd8aaef
3 files changed
+12
-7
No files matched your search
@@ -170,9 +170,10 @@ func WriteRelayError(w http.ResponseWriter, err error) {
|
||||
statusCode = http.StatusInternalServerError
|
||||
}
|
||||
|
||||
// 记录错误日志
|
||||
g.Log().Errorf(context.Background(), "[RelayError] statusCode=%d type=%s message=%s originalError=%v",
|
||||
statusCode, errType, errMsg, err)
|
||||
if statusCode >= 500 {
|
||||
g.Log().Errorf(context.Background(), "[RelayError] statusCode=%d type=%s message=%s originalError=%v",
|
||||
statusCode, errType, errMsg, err)
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(statusCode)
|
||||
|
||||
@@ -48,8 +48,10 @@ func WriteClaudeRelayError(w http.ResponseWriter, err error) {
|
||||
statusCode = http.StatusInternalServerError
|
||||
}
|
||||
|
||||
g.Log().Errorf(context.Background(), "[ClaudeRelayError] statusCode=%d type=%s message=%s originalError=%v",
|
||||
statusCode, errType, errMsg, err)
|
||||
if statusCode >= 500 {
|
||||
g.Log().Errorf(context.Background(), "[ClaudeRelayError] statusCode=%d type=%s message=%s originalError=%v",
|
||||
statusCode, errType, errMsg, err)
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(statusCode)
|
||||
|
||||
@@ -95,8 +95,10 @@ func WriteGeminiRelayError(w http.ResponseWriter, err error) {
|
||||
statusCode = http.StatusInternalServerError
|
||||
}
|
||||
|
||||
g.Log().Errorf(context.Background(), "[GeminiRelayError] statusCode=%d status=%s message=%s originalError=%v",
|
||||
statusCode, errStatus, errMsg, err)
|
||||
if statusCode >= 500 {
|
||||
g.Log().Errorf(context.Background(), "[GeminiRelayError] statusCode=%d status=%s message=%s originalError=%v",
|
||||
statusCode, errStatus, errMsg, err)
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(statusCode)
|
||||
|
||||
Reference in new issue
Block a user