# HG changeset patch # User Sascha L. Teichmann # Date 1624391908 -7200 # Node ID 04b3fb35910c88ca70f61478c6bc4d12d77d20b9 # Parent f733bb327b9b76b3cf300df29ee085b4ab7a793c XLSX templater: More logging in case of expression eval errors. Break over long lines. diff -r f733bb327b9b -r 04b3fb35910c pkg/xlsx/templater.go --- a/pkg/xlsx/templater.go Tue Jun 22 18:14:08 2021 +0200 +++ b/pkg/xlsx/templater.go Tue Jun 22 21:58:28 2021 +0200 @@ -566,7 +566,10 @@ return vars } -func (e *executor) expand(str string, vars map[string]interface{}) (string, error) { +func (e *executor) expand( + str string, + vars map[string]interface{}, +) (string, error) { var err error @@ -589,7 +592,10 @@ return str, err } -func (e *executor) typedExpand(str string, vars map[string]interface{}) (interface{}, error) { +func (e *executor) typedExpand( + str string, + vars map[string]interface{}, +) (interface{}, error) { var ( err error @@ -607,6 +613,9 @@ } repCount++ last, err = eval(e.ctx, vars) + if err != nil { + log.Printf("error: '%s' '%s' %v\n", str, s, err) + } return fmt.Sprintf("%v", last) } @@ -616,7 +625,9 @@ return nil, err } - if repCount == 1 && strings.HasPrefix(str, "{{") && strings.HasSuffix(str, "}}") { + if repCount == 1 && + strings.HasPrefix(str, "{{") && + strings.HasSuffix(str, "}}") { return last, nil } return nstr, nil