mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-10 08:03:41 +08:00
修复tts异常时仍然扣费的问题
This commit is contained in:
@@ -147,6 +147,11 @@ func relayImageHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
|
||||
if err != nil {
|
||||
return errorWrapper(err, "close_request_body_failed", http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return relayErrorHandler(resp)
|
||||
}
|
||||
|
||||
var textResponse ImageResponse
|
||||
defer func(ctx context.Context) {
|
||||
if consumeQuota {
|
||||
|
||||
Reference in New Issue
Block a user