From 1c0f35fd1aa38584ff715daf2468cf5b1b88f590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 21 Jun 2018 00:34:34 +0200 Subject: [PATCH] Update errorf.md --- content/en/functions/errorf.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/en/functions/errorf.md b/content/en/functions/errorf.md index 9105ff840..1e5b47ff0 100644 --- a/content/en/functions/errorf.md +++ b/content/en/functions/errorf.md @@ -19,8 +19,11 @@ aliases: [] --- `errorf` will evaluate a format string, then output the result to the ERROR log. -This will also cause the build to fail. + +This will also cause the build to fail (the `hugo` command will `exit -1`). ``` -{{ errorf "Something went horribly wrong! %s" err }} +{{ errorf "Failed to handle page %q" .Path }} ``` + +Note that `errorf` supports all the formatting verbs of the [fmt](https://golang.org/pkg/fmt/) package.