Skip to content

Commit

Permalink
hugolib: Log WARNING only on unknown /data files
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Apr 18, 2017
1 parent 7cdc244 commit ab692e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
9 changes: 0 additions & 9 deletions hugolib/datafiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,6 @@ func TestDataDirMultipleSources(t *testing.T) {

}

func TestDataDirUnknownFormat(t *testing.T) {
t.Parallel()

sources := []source.ByteSource{
{Name: filepath.FromSlash("data/test.roml"), Content: []byte("boo")},
}
doTestDataDir(t, true, sources)
}

func doTestDataDir(t *testing.T, expected interface{}, sources []source.ByteSource, configKeyValues ...interface{}) {
var (
cfg, fs = newTestCfg()
Expand Down
3 changes: 2 additions & 1 deletion hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,8 @@ func (s *Site) loadData(sources []source.Input) (err error) {

data, err := s.readData(r)
if err != nil {
return fmt.Errorf("Failed to read data from %s: %s", filepath.Join(r.Path(), r.LogicalName()), err)
s.Log.WARN.Printf("Failed to read data from %s: %s", filepath.Join(r.Path(), r.LogicalName()), err)
continue
}

if data == nil {
Expand Down

0 comments on commit ab692e7

Please sign in to comment.