templates: better error message
This commit is contained in:
parent
f6a0eb8e14
commit
a9ae91c2d8
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue