templates: better error message

This commit is contained in:
Reto Brunner 2020-11-11 13:57:42 +01:00
parent f6a0eb8e14
commit a9ae91c2d8
1 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@ package templates
import ( import (
"bytes" "bytes"
"errors" "fmt"
"io" "io"
"net/mail" "net/mail"
"os" "os"
@ -190,7 +190,8 @@ func findTemplate(templateName string, templateDirs []string) (string, error) {
return templateFile, nil 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) { func ParseTemplateFromFile(templateName string, templateDirs []string, data interface{}) (io.Reader, error) {