little-cui commented on a change in pull request #307: [SCB-376] Optimize
validate parameter log print
URL:
https://github.com/apache/incubator-servicecomb-service-center/pull/307#discussion_r174658926
##########
File path: pkg/validate/validate.go
##########
@@ -238,7 +238,7 @@ func (v *Validator) Validate(s interface{}) error {
}
// TODO null pointer如何校验
if field.Kind() != reflect.Ptr && !validate.Match(fi) {
- return fmt.Errorf("%s validate failed, %s",
fieldName, validate)
+ return fmt.Errorf("invalid field: %s.%s,
invalid value: {%v} , %s", st.Type.Name(), fieldName, fi, validate)
Review comment:
we should not print the value in error message because of the secret risk
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services