addrs: Fix diagnostic for invalid provider type
This previously rendered as `Invalid provider type ""`, as `name` was empty if parsing failed. Using the source string is more helpful.
This commit is contained in:
parent
7165d6c429
commit
cadc133828
|
@ -192,7 +192,7 @@ func ParseProviderSourceString(str string) (Provider, tfdiags.Diagnostics) {
|
||||||
diags = diags.Append(&hcl.Diagnostic{
|
diags = diags.Append(&hcl.Diagnostic{
|
||||||
Severity: hcl.DiagError,
|
Severity: hcl.DiagError,
|
||||||
Summary: "Invalid provider type",
|
Summary: "Invalid provider type",
|
||||||
Detail: fmt.Sprintf(`Invalid provider type %q in source %q: %s"`, name, str, err),
|
Detail: fmt.Sprintf(`Invalid provider type %q in source %q: %s"`, givenName, str, err),
|
||||||
})
|
})
|
||||||
return ret, diags
|
return ret, diags
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue