From: Cameron Moore Date: Wed, 3 Oct 2018 03:26:08 +0000 (-0500) Subject: hugolib: Improve error message for bad taxonomy weights X-Git-Tag: v0.50~79 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d3b81ee58;p=brevno-suite%2Fhugo hugolib: Improve error message for bad taxonomy weights Error is now "Unable to convert taxonomy weight []string{"40"} to int for variables/files.md" --- diff --git a/hugolib/site.go b/hugolib/site.go index f7f84b47..71a8a03e 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1470,9 +1470,10 @@ func (s *Site) assembleTaxonomies() { for _, p := range s.Pages { vals := p.getParam(plural, !s.Info.preserveTaxonomyNames) - weight, err := cast.ToIntE(p.getParamToLower(plural + "_weight")) + w := p.getParamToLower(plural + "_weight") + weight, err := cast.ToIntE(w) if err != nil { - s.Log.ERROR.Print("unable to convert taxonomy weight to int") + s.Log.ERROR.Printf("Unable to convert taxonomy weight %#v to int for %s", w, p.Source.File.Path()) // weight will equal zero, so let the flow continue }