tfdiags: Unwrap NonFatalError on append
This is a variant of diagnosticsAsError that we use to signal to informed callers that there might just be warnings inside, but we should also do the right thing if a caller just appends it to an existing diagnostics without checking first.
This commit is contained in:
parent
8d0bec5728
commit
abf0284ca5
|
@ -54,6 +54,8 @@ func (diags Diagnostics) Append(new ...interface{}) Diagnostics {
|
|||
diags = append(diags, ti...) // flatten
|
||||
case diagnosticsAsError:
|
||||
diags = diags.Append(ti.Diagnostics) // unwrap
|
||||
case NonFatalError:
|
||||
diags = diags.Append(ti.Diagnostics) // unwrap
|
||||
case hcl.Diagnostics:
|
||||
for _, hclDiag := range ti {
|
||||
diags = append(diags, hclDiagnostic{hclDiag})
|
||||
|
|
Loading…
Reference in New Issue