Skip to content

Commit a61664c

Browse files
committed
add better error message
1 parent e6a529d commit a61664c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

provider/parameter.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,14 @@ func (v *Parameter) validValue(value string, optionType OptionType, optionValues
544544
} else {
545545
_, isValid := optionValues[value]
546546
if !isValid {
547+
extra := ""
548+
if value == "" {
549+
extra = ". The value is empty, did you forget to set it with a default or from user input?"
550+
}
547551
return diag.Diagnostics{
548552
{
549553
Severity: diag.Error,
550-
Summary: fmt.Sprintf("%s must be a valid option", name),
554+
Summary: fmt.Sprintf("%s must be a valid option%s", name, extra),
551555
Detail: fmt.Sprintf("the value %q must be defined as one of options", value),
552556
AttributePath: path,
553557
},

0 commit comments

Comments
 (0)