Skip to content

Commit

Permalink
fix: don't fail if favicon is not available
Browse files Browse the repository at this point in the history
Log a warning and continue
  • Loading branch information
ashishb committed May 25, 2024
1 parent d223ad4 commit 8293145
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/wp2hugo/internal/hugogenerator/hugo_gen_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ func (g Generator) Generate() error {
url1 := info.Link + "/favicon.ico"
media, err := g.mediaProvider.GetReader(url1)
if err != nil {
return fmt.Errorf("error fetching media file %s: %s", url1, err)
}
if err = writeFavicon(path.Join(*siteDir, "static"), media); err != nil {
return err
log.Error().
Err(err).
Str("url", url1).
Msg("error fetching favicon")
} else {
if err = writeFavicon(path.Join(*siteDir, "static"), media); err != nil {
return err
}
}
}
log.Debug().
Expand Down

0 comments on commit 8293145

Please sign in to comment.