summaryrefslogtreecommitdiffstats
path: root/docs/content/en/functions/fmt/Errorf.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/functions/fmt/Errorf.md')
-rw-r--r--docs/content/en/functions/fmt/Errorf.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/content/en/functions/fmt/Errorf.md b/docs/content/en/functions/fmt/Errorf.md
new file mode 100644
index 000000000..bbdd62c53
--- /dev/null
+++ b/docs/content/en/functions/fmt/Errorf.md
@@ -0,0 +1,26 @@
+---
+title: fmt.Errorf
+description: Log an ERROR from a template.
+categories: []
+keywords: []
+action:
+ aliases: [errorf]
+ related:
+ - functions/fmt/Erroridf
+ - functions/fmt/Warnf
+ returnType: string
+ signatures: ['fmt.Errorf FORMAT [INPUT]']
+aliases: [/functions/errorf]
+---
+
+{{% include "functions/fmt/_common/fmt-layout.md" %}}
+
+The `errorf` function evaluates the format string, then prints the result to the ERROR log and fails the build.
+
+```go-html-template
+{{ errorf "The %q shortcode requires a src parameter. See %s" .Name .Position }}
+```
+
+Use the [`erroridf`] function to allow optional suppression of specific errors.
+
+[`erroridf`]: /functions/fmt/erroridf