summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorCameron Moore <moorereason@gmail.com>2018-10-02 22:26:08 -0500
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-10-03 09:34:45 +0300
commitd3b81ee58e8fd3a0ab8265a2898d66cbcdf6a7c1 (patch)
tree110ad6723c19565eea4a22ab7ebc16fe3d4fe58d /hugolib
parent1fd30d462ee7f67fde6f29d170af1d225258322b (diff)
hugolib: Improve error message for bad taxonomy weights
Error is now "Unable to convert taxonomy weight []string{"40"} to int for variables/files.md"
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/site.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index f7f84b47d..71a8a03e3 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
}