core: Don't swallow errors in EvalApply
Incorrect pointer discipline here was causing the error to be lost rather than returned as expected. Additionally we'll include a log line in this case because otherwise an apply error is reported so far from the actual apply operation that it can be difficult to understand what happened.
This commit is contained in:
parent
084e25c60a
commit
d043dec488
|
@ -161,7 +161,8 @@ func (n *EvalApply) Eval(ctx EvalContext) (interface{}, error) {
|
|||
// success.
|
||||
if n.Error != nil {
|
||||
err := diags.Err()
|
||||
n.Error = &err
|
||||
*n.Error = err
|
||||
log.Printf("[DEBUG] %s: apply errored, but we're indicating that via the Error pointer rather than returning it: %s", n.Addr.Absolute(ctx.Path()), err)
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue