Skip to content

Commit 0afacab

Browse files
committed
genall.Runtime.Run: Make sure we don't ignore returned errors
1 parent 20997b1 commit 0afacab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/genall/genall.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,16 @@ func (r *Runtime) Run() bool {
165165
return true
166166
}
167167

168+
hadErrs := false
168169
for _, gen := range r.Generators {
169170
ctx := r.GenerationContext // make a shallow copy
170171
ctx.OutputRule = r.OutputRules.ForGenerator(gen)
171172
if err := (*gen).Generate(&ctx); err != nil {
172173
fmt.Fprintln(os.Stderr, err)
174+
hadErrs = true
173175
}
174176
}
175177

176178
// skip TypeErrors -- they're probably just from partial typechecking in crd-gen
177-
return loader.PrintErrors(r.Roots, packages.TypeError)
179+
return loader.PrintErrors(r.Roots, packages.TypeError) || hadErrs
178180
}

0 commit comments

Comments
 (0)