MCPcopy
hub / github.com/opentofu/opentofu / Err

Method Err

internal/tfdiags/diagnostics.go:159–164  ·  view source on GitHub ↗

Err flattens a diagnostics list into a single Go error, or to nil if the diagnostics list does not include any error-level diagnostics. This can be used to smuggle diagnostics through an API that deals in native errors, but unfortunately it will lose any warnings that aren't accompanied by at least

()

Source from the content-addressed store, hash-verified

157//
158// return result, diags.Error()
159func (diags Diagnostics) Err() error {
160 if !diags.HasErrors() {
161 return nil
162 }
163 return diagnosticsAsError{diags}
164}
165
166// ErrWithWarnings is similar to Err except that it will also return a non-nil
167// error if the receiver contains only warnings.

Callers 15

opPlanMethod · 0.95
opApplyMethod · 0.95
unusableSavedPlanErrorFunction · 0.95
generalErrorFunction · 0.95
ProviderAddrMethod · 0.95
LoadSchemasFunction · 0.95
ErrWithWarningsMethod · 0.95
TestDiagnosticsErrFunction · 0.95
TestStateViewsFunction · 0.95
opPlanMethod · 0.95

Calls 1

HasErrorsMethod · 0.95