~sircmpwn/aerc

a9ae91c2d8d106ec85650fc0534c9cdffa8541eb — Reto Brunner 7 months ago f6a0eb8
templates: better error message
1 files changed, 3 insertions(+), 2 deletions(-)

M lib/templates/template.go
M lib/templates/template.go => lib/templates/template.go +3 -2
@@ 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) {