templates: better error message

This commit is contained in:
Reto Brunner 2020-11-11 13:57:42 +01:00
parent f6a0eb8e14
commit a9ae91c2d8

View file

@ -2,7 +2,7 @@ package templates
import (
"bytes"
"errors"
"fmt"
"io"
"net/mail"
"os"
@ -190,7 +190,8 @@ func findTemplate(templateName string, templateDirs []string) (string, error) {
return templateFile, nil
}
return "", errors.New("Can't find template - " + templateName)
return "", fmt.Errorf(
"Can't find template %q in any of %v ", templateName, templateDirs)
}
func ParseTemplateFromFile(templateName string, templateDirs []string, data interface{}) (io.Reader, error) {