diff --git a/render.go b/render.go index 114c51d..e8cae2d 100644 --- a/render.go +++ b/render.go @@ -6,6 +6,7 @@ import ( "html/template" "io" "io/ioutil" + "log" ) func Render(m *Mixtape, w io.Writer) error { @@ -15,15 +16,22 @@ func Render(m *Mixtape, w io.Writer) error { } mixtapeRawTmpl, err := ioutil.ReadFile("mixtape.tmpl") if err != nil { + log.Print("Unable to load local mixtape.tmpl; falling back to default") mixtapeRawTmpl, err = ReadAsset("mixtape.tmpl", false) if err != nil { return err } + } else { + log.Print("Generating from local mixtape.tmpl") } t, err := template.New("mixtape").Parse(string(mixtapeRawTmpl) + string(partsRawTmpl)) if err != nil { + log.Printf("[ERROR] Unable to parse: %v", err) return err } - t.ExecuteTemplate(w, "mixtape", m) + err = t.ExecuteTemplate(w, "mixtape", m) + if err != nil { + log.Printf("[ERROR] Unable to render: %v", err) + } return nil }