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

Lines changed: 5 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy