NewValidationError constructs a *ValidationError with Category locked to CategoryValidation and Message formatted via fmt.Sprintf(format, args...).
(subtype Subtype, format string, args ...any)
| 106 | // NewValidationError constructs a *ValidationError with Category locked to |
| 107 | // CategoryValidation and Message formatted via fmt.Sprintf(format, args...). |
| 108 | func NewValidationError(subtype Subtype, format string, args ...any) *ValidationError { |
| 109 | return &ValidationError{ |
| 110 | Problem: Problem{ |
| 111 | Category: CategoryValidation, |
| 112 | Subtype: subtype, |
| 113 | Message: formatMessage(format, args), |
| 114 | }, |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | func (e *ValidationError) WithHint(format string, args ...any) *ValidationError { |
| 119 | e.Hint = formatMessage(format, args) |