()
| 23 | } |
| 24 | |
| 25 | func (e *FieldIDNotFoundError) Error() string { |
| 26 | if len(e.Candidates) == 0 { |
| 27 | return fmt.Sprintf("field with ID %q not found in project; the project has no fields", e.ID) |
| 28 | } |
| 29 | return fmt.Sprintf("field with ID %q not found in project; available fields: %s", e.ID, strings.Join(e.Candidates, ", ")) |
| 30 | } |
| 31 | |
| 32 | // FieldNotFoundError is returned when no project field matches the given name. |
| 33 | // Candidates lists the available field names so the caller can self-correct. |