diff --git a/manipulations/opengraphimg/opengraphimg.go b/manipulations/opengraphimg/opengraphimg.go index 85e2f67..8d59639 100644 --- a/manipulations/opengraphimg/opengraphimg.go +++ b/manipulations/opengraphimg/opengraphimg.go @@ -18,6 +18,7 @@ package opengraphimg import ( "fmt" + "log" "sort" "strings" "sync" @@ -63,7 +64,8 @@ func Manipulator(runtime manipulations.Runtime, doc *html.Node) error { img, err := getSuitableImg(runtime, c.Val) if err != nil { - return err + log.Printf("Warning: Unable to find suitable image for %q: %v", c.Val, err) + continue } if img == nil { diff --git a/manipulations/opengraphimg/opengraphimg_test.go b/manipulations/opengraphimg/opengraphimg_test.go index 5d9eed3..30480fa 100644 --- a/manipulations/opengraphimg/opengraphimg_test.go +++ b/manipulations/opengraphimg/opengraphimg_test.go @@ -58,13 +58,13 @@ func TestManipulator(t *testing.T) { wantHTML: `
`, }, { - description: "return error if getting images fails", + description: "do nothing if getting images fails", findNodes: htmlparsing.FindNodesByTag, doc: MustGetNode(t, ``), genimgsLookupSizes: func(s3 *s3.Client, conf *config.Config, imgPath string) ([]genimgs.GenImg, error) { return nil, errInjected }, - wantError: errInjected, + wantHTML: ``, }, { description: "do nothing when no images",