starsz commented on a change in pull request #1064:
URL: https://github.com/apache/apisix-dashboard/pull/1064#discussion_r546236790



##########
File path: api/internal/utils/consts/api_error.go
##########
@@ -27,7 +29,21 @@ func ErrorWrapper(handle WrapperHandle) gin.HandlerFunc {
        return func(c *gin.Context) {
                data, err := handle(c)
                if err != nil {
-                       apiError := err.(*ApiError)
+                       apiError, ok := err.(*ApiError)
+                       if !ok {
+                               errMsg := err.Error()
+                               if strings.Contains(errMsg, "required") ||

Review comment:
       I had seen the same code in `hadler.go`.
   
https://github.com/apache/apisix-dashboard/blob/cb1377cf9859392ee81ee60b3d4e623b1522be1e/api/internal/handler/handler.go#L55-L61
   
   So I think we'd better discuss about the response error.
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to