You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/20 01:43:32 UTC

[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #563: feat: compatible with HTTP status of `admin api`

liuxiran commented on a change in pull request #563:
URL: https://github.com/apache/apisix-dashboard/pull/563#discussion_r508158329



##########
File path: api/internal/core/store/validate.go
##########
@@ -125,17 +125,17 @@ func (v *APISIXJsonSchemaValidator) Validate(obj interface{}) error {
 		for pluginName, pluginConf := range plugins {
 			schemaDef := conf.Schema.Get("plugins." + pluginName).String()
 			if schemaDef == "" {
-				return fmt.Errorf("schema not found")
+				return fmt.Errorf("scheme validate failed: schema not found")
 			}
 
 			s, err := gojsonschema.NewSchema(gojsonschema.NewStringLoader(schemaDef))
 			if err != nil {
-				return fmt.Errorf("new schema failed: %w", err)
+				return fmt.Errorf("scheme validate failed: %w", err)
 			}
 
 			ret, err := s.Validate(gojsonschema.NewGoLoader(pluginConf))
 			if err != nil {
-				return fmt.Errorf("validate failed: %w", err)
+				return fmt.Errorf("scheme validate failed: %w", err)

Review comment:
       I found that the same error messages repeatedly appeared in the files, would it be better to  manage error messages in one place just like [error.go](https://github.com/apache/apisix-dashboard/blob/master/api/errno/error.go) before :)?




----------------------------------------------------------------
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:
users@infra.apache.org