Skip to content

Commit

Permalink
make post evaluation errors more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Jan 7, 2025
1 parent 1aa5bf8 commit 4dcc8ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/runtime/internal/controller/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,11 @@ func (l *Loader) postEvaluate(logger log.Logger, bn BlockNode, err error) error
// We also want to cache it in case of an error
err2 := l.cache.CacheExports(c.ID(), c.Exports())
if err2 != nil {
level.Error(logger).Log("msg", "failed to cache exports after evaluation", "err", err2)
// Don't mask the previous evaluation error.
if err == nil {
if err != nil {
level.Error(logger).Log("msg", "evaluation and exports caching failed", "eval err", err, "caching err", err2)
return errors.Join(err, err2)
} else {
level.Error(logger).Log("msg", "failed to cache exports after evaluation", "err", err2)
return err2
}
}
Expand Down

0 comments on commit 4dcc8ee

Please sign in to comment.