tpl/collections: Use Feedback log instead of Error in IsSet
authorCameron Moore <moorereason@gmail.com>
Thu, 18 May 2017 18:23:03 +0000 (13:23 -0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 18 May 2017 18:54:42 +0000 (21:54 +0300)
Using the Error log will cause Hugo to exit with an error, which could
break site build workflows.

tpl/collections/collections.go

index f2816e4f180ecb8897778e35fd995dba02a05194..61459ee6bc4ea1ea9e087370cd4c0fcb7c049574 100644 (file)
@@ -371,7 +371,7 @@ func (ns *Namespace) IsSet(a interface{}, key interface{}) (bool, error) {
                        return av.MapIndex(kv).IsValid(), nil
                }
        default:
-               ns.deps.Log.ERROR.Printf("calling IsSet with unsupported type %T will always return false", a)
+               ns.deps.Log.FEEDBACK.Printf("WARNING: calling IsSet with unsupported type %q (%T) will always return false.\n", av.Kind(), a)
        }
 
        return false, nil