mirror of
https://github.com/helm/helm.git
synced 2026-02-03 20:39:45 -05:00
The templating engine handles errors originating from the `required` and `fail` template functions specially, cleaning up the error messages to be more presentable to users. Go's text/template package unfortunately does not make this straightforward to implement. Despite template.ExecError implementing Unwrap, the error value returned from the template function cannot be retrieved using errors.As. The wrapped error in ExecError is a pre-formatted error string with the template function's error string interpolated in with the original error value erased. Helm works around this limitation by delimiting the template-supplied message and extracting the message out of the ExecError string with a regex. Fix the parsing of `required` and `fail` error messages containing newlines by setting the regex flag to make `.` match newline characters. Signed-off-by: Cory Snider <csnider@mirantis.com> |
||
|---|---|---|
| .. | ||
| doc.go | ||
| engine.go | ||
| engine_test.go | ||
| files.go | ||
| files_test.go | ||
| funcs.go | ||
| funcs_test.go | ||
| lookup_func.go | ||