fail and Custom Validation Guards
Stopping rendering with clear, actionable errors.
Guarding Bad Input
Charts should reject nonsensical configuration early. A good template can stop rendering and tell the user exactly what went wrong.
Stopping with fail
The fail function halts template rendering immediately and prints the message you give it as the error.
{{ fail "service.port must be set" }}All lessons in this course
- Deep Merge with mergeOverwrite and dict
- tpl: Rendering Strings from Values
- Looping Files with range Over .Files.Glob
- fail and Custom Validation Guards