Files
opencatd-open/team/dto/openai/err_resp.go
Sakurasan bc223d6530 team api
2025-02-01 23:52:55 +08:00

23 lines
345 B
Go

package dto
import (
"net/http"
"github.com/gin-gonic/gin"
)
type Error struct {
Message string `json:"message,omitempty"`
Code string `json:"code,omitempty"`
}
func WarpErrAsOpenAI(c *gin.Context, msg string, code string) {
c.JSON(http.StatusForbidden, gin.H{
"error": Error{
Message: msg,
Code: code,
},
})
return
}