github.com/rabbouni145/gg@v0.47.1/docs/content/en/functions/errorf.md (about) 1 --- 2 title: errorf 3 linktitle: errorf 4 description: Log ERROR and fail the build from the templates. 5 date: 2017-09-30 6 publishdate: 2017-09-30 7 lastmod: 2017-09-30 8 categories: [functions] 9 menu: 10 docs: 11 parent: "functions" 12 keywords: [strings, log, error] 13 signature: ["errorf FORMAT INPUT"] 14 workson: [] 15 hugoversion: 16 relatedfuncs: [printf] 17 deprecated: false 18 aliases: [] 19 --- 20 21 `errorf` will evaluate a format string, then output the result to the ERROR log (and only once per error message to avoid flooding the log). 22 23 This will also cause the build to fail (the `hugo` command will `exit -1`). 24 25 ``` 26 {{ errorf "Failed to handle page %q" .Path }} 27 ``` 28 29 Note that `errorf` supports all the formatting verbs of the [fmt](https://golang.org/pkg/fmt/) package.