Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2cb01cc

Browse files
committed
add better error message
1 parent6ee8b80 commit2cb01cc

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+
ifvalue=="" {
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)

[8]ページ先頭

©2009-2025 Movatter.jp