Explorar el Código

无效的请求返回具体原因

CaIon hace 2 años
padre
commit
b86bc169a5
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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)
 			}
 			if err != nil {
-				abortWithMessage(c, http.StatusBadRequest, "无效的请求")
+				abortWithMessage(c, http.StatusBadRequest, "无效的请求: "+err.Error())
 				return
 			}
 			if strings.HasPrefix(c.Request.URL.Path, "/v1/moderations") {