sync: fix hint dependancies error not reported

This commit is contained in:
nemunaire 2020-01-23 14:23:45 +01:00
parent 9d93331868
commit 7bec409ab8

View File

@ -127,7 +127,9 @@ func SyncExerciceHints(i Importer, exercice fic.Exercice, flagsBindings map[int6
// Handle hints dependencies on flags
for _, nf := range hint.FlagsDeps {
if f, ok := flagsBindings[nf]; ok {
h.AddDepend(f)
if herr := h.AddDepend(f); herr != nil {
errs = append(errs, fmt.Sprintf("%q: error hint #%d dependency to flag #%d: %s", path.Base(exercice.Path), hint.Line, nf, herr))
}
} else {
errs = append(errs, fmt.Sprintf("%q: error hint #%d dependency to flag #%d: Unexistant flag", path.Base(exercice.Path), hint.Line, nf))
}