fix: update abortWithOpenAiMessage function to use types.ErrorCode
This commit is contained in:
@@ -5,13 +5,14 @@ import (
|
||||
|
||||
"github.com/QuantumNous/new-api/common"
|
||||
"github.com/QuantumNous/new-api/logger"
|
||||
"github.com/QuantumNous/new-api/types"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func abortWithOpenAiMessage(c *gin.Context, statusCode int, message string, code ...string) {
|
||||
func abortWithOpenAiMessage(c *gin.Context, statusCode int, message string, code ...types.ErrorCode) {
|
||||
codeStr := ""
|
||||
if len(code) > 0 {
|
||||
codeStr = code[0]
|
||||
codeStr = string(code[0])
|
||||
}
|
||||
userId := c.GetInt("id")
|
||||
c.JSON(statusCode, gin.H{
|
||||
|
||||
Reference in New Issue
Block a user