Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

searchattribute: quote name in error messages #6509

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions common/searchattribute/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ func (v *Validator) Validate(searchAttributes *commonpb.SearchAttributes, namesp
if err != nil {
if errors.Is(err, ErrInvalidName) {
return v.validationError(
"search attribute %s is not defined",
"search attribute %q is not defined",
saFieldName,
namespace,
)
}
return v.validationError(
fmt.Sprintf("unable to get %s search attribute type: %v", "%s", err),
fmt.Sprintf("unable to get %q search attribute type: %v", "%s", err),
saFieldName,
namespace,
)
Expand All @@ -143,7 +143,7 @@ func (v *Validator) Validate(searchAttributes *commonpb.SearchAttributes, namesp
}
return v.validationError(
fmt.Sprintf(
"invalid value for search attribute %s of type %s: %v",
"invalid value for search attribute %q of type %s: %v",
"%s",
saType,
invalidValue,
Expand All @@ -169,7 +169,7 @@ func (v *Validator) ValidateSize(searchAttributes *commonpb.SearchAttributes, na
if len(saPayload.GetData()) > v.searchAttributesSizeOfValueLimit(namespace) {
return v.validationError(
fmt.Sprintf(
"search attribute %s value size %d exceeds size limit %d",
"search attribute %q value size %d exceeds size limit %d",
"%s",
len(saPayload.GetData()),
v.searchAttributesSizeOfValueLimit(namespace),
Expand Down