Quellcode durchsuchen

无效的请求返回具体原因

CaIon vor 2 Jahren
Ursprung
Commit
b86bc169a5
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      middleware/distributor.go

+ 1 - 1
middleware/distributor.go

@@ -50,7 +50,7 @@ func Distribute() func(c *gin.Context) {
 				err = common.UnmarshalBodyReusable(c, &modelRequest)
 				err = common.UnmarshalBodyReusable(c, &modelRequest)
 			}
 			}
 			if err != nil {
 			if err != nil {
-				abortWithMessage(c, http.StatusBadRequest, "无效的请求")
+				abortWithMessage(c, http.StatusBadRequest, "无效的请求: "+err.Error())
 				return
 				return
 			}
 			}
 			if strings.HasPrefix(c.Request.URL.Path, "/v1/moderations") {
 			if strings.HasPrefix(c.Request.URL.Path, "/v1/moderations") {