15
16
// Append an issue to the set.
18
>
ri.issues = append(ri.issues, issue)
19
>
}
20
21
// Appendf appends a formatted issue to the set.
22
>
func (ri *RequestIssues) Appendf(format string, args ...any) {
request_issues.go
23
>
ri.Append(fmt.Sprintf(format, args...))
24
>
}
25
26
// GetError returns a gRPC INVALID_ARGUMENT error representing the issues in the set or nil if there are no issues.
28
>
if len(ri.issues) == 0 {
29
>
return nil
30
>
}
31
>
return status.Error(codes.InvalidArgument, strings.Join(ri.issues, ", "))
32
}