summaryrefslogtreecommitdiff
path: root/lib/templates
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-11-11 13:57:42 +0100
committerReto Brunner <reto@labrat.space>2020-11-11 13:58:05 +0100
commita9ae91c2d8d106ec85650fc0534c9cdffa8541eb (patch)
tree1e2e73ccf995b2f35ec6d72f7898a3c3228a30af /lib/templates
parentf6a0eb8e14c25e49ca18dfc89726a7123afccd67 (diff)
downloadaerc-a9ae91c2d8d106ec85650fc0534c9cdffa8541eb.zip
templates: better error message
Diffstat (limited to 'lib/templates')
-rw-r--r--lib/templates/template.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/templates/template.go b/lib/templates/template.go
index 4346111..1c7b546 100644
--- a/lib/templates/template.go
+++ b/lib/templates/template.go
@@ -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) {