Skip to content

Commit

Permalink
addrs: Fix diagnostic for invalid provider type
Browse files Browse the repository at this point in the history
This previously rendered as `Invalid provider type ""`, as `name` was
empty if parsing failed. Using the source string is more helpful.
  • Loading branch information
alisdair committed Apr 2, 2020
1 parent 7165d6c commit cadc133
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addrs/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func ParseProviderSourceString(str string) (Provider, tfdiags.Diagnostics) {
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,
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
}
Expand Down

0 comments on commit cadc133

Please sign in to comment.