From 7bec409ab826b32aebac861c75df2f0466a759ea Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Thu, 23 Jan 2020 14:23:45 +0100 Subject: [PATCH] sync: fix hint dependancies error not reported --- admin/sync/exercice_hints.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/sync/exercice_hints.go b/admin/sync/exercice_hints.go index 9eb8c871..d485e7fb 100644 --- a/admin/sync/exercice_hints.go +++ b/admin/sync/exercice_hints.go @@ -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)) }