tpl/fmt: Print suppression help with erroridf

Closes #11506
This commit is contained in:
Joe Mooring
2023-12-03 11:06:33 -08:00
committed by Bjørn Erik Pedersen
parent 4583b41305
commit d24da1712f
2 changed files with 47 additions and 0 deletions

View File

@@ -68,6 +68,8 @@ func (ns *Namespace) Errorf(format string, args ...any) string {
// an information text that the error with the given id can be suppressed in config.
// It returns an empty string.
func (ns *Namespace) Erroridf(id, format string, args ...any) string {
format += "\nYou can suppress this error by adding the following to your site configuration:\nignoreErrors = ['%s']"
args = append(args, id)
ns.logger.Errorsf(id, format, args...)
return ""
}