configs: A better error message for custom variable validation
Our previous message conflated the requirement for a full sentence with the suggestion to write in a style similar to Terraform's built-in error messages, which created a sense that the system would actively reject an error message written in another language. There's no intent here to block writing error messages in other languages, but there is a practical consideration that Terraform's UI output is currently not localized and so consistency with Terraform's other output, if that's important to a module author, will typically mean writing the error message in English.
This commit is contained in:
parent
f172585eaa
commit
54cc4dadf6
|
@ -382,7 +382,7 @@ func decodeVariableValidationBlock(varName string, block *hcl.Block, override bo
|
|||
diags = diags.Append(&hcl.Diagnostic{
|
||||
Severity: hcl.DiagError,
|
||||
Summary: errSummary,
|
||||
Detail: "Validation error message must be at least one full English sentence starting with an uppercase letter and ending with a period or question mark.",
|
||||
Detail: "The validation error message must be at least one full sentence starting with an uppercase letter and ending with a period or question mark.\n\nYour given message will be included as part of a larger Terraform error message, written as English prose. For broadly-shared modules we suggest using a similar writing style so that the overall result will be consistent.",
|
||||
Subject: attr.Expr.Range().Ptr(),
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue