Validate reports whether the run failure contains a message and bounded metadata.
(path string)
| 923 | |
| 924 | // Validate reports whether the run failure contains a message and bounded metadata. |
| 925 | func (r RunFailure) Validate(path string) error { |
| 926 | if strings.TrimSpace(r.Error) == "" { |
| 927 | return fmt.Errorf("%w: %s is required", ErrValidation, nestedPath(path, "error")) |
| 928 | } |
| 929 | if err := ValidatePayloadSize(r.Metadata, nestedPath(path, "metadata")); err != nil { |
| 930 | return err |
| 931 | } |
| 932 | if hasRawClaimTokenField(r.Metadata) { |
| 933 | return fmt.Errorf("%w: %s must not contain raw lease credentials", ErrValidation, nestedPath(path, "metadata")) |
| 934 | } |
| 935 | return nil |
| 936 | } |
| 937 | |
| 938 | // Validate reports whether the task-query filters are internally consistent. |
| 939 | func (q Query) Validate(path string) error { |
no test coverage detected