Skip to content

Commit

Permalink
Do not log website without icon as warning
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Oct 20, 2023
1 parent 9fd2dfa commit 5ac3489
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/reader/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func checkFeedIcon(store *storage.Storage, feedID int64, websiteURL, feedIconURL
if !store.HasIcon(feedID) {
iconFinder := icon.NewIconFinder(websiteURL, feedIconURL, userAgent, fetchViaProxy, allowSelfSignedCertificates)
if icon, err := iconFinder.FindIcon(); err != nil {
slog.Warn("Unable to find feed icon",
slog.Debug("Unable to find feed icon",
slog.Int64("feed_id", feedID),
slog.String("website_url", websiteURL),
slog.String("feed_icon_url", feedIconURL),
Expand Down
6 changes: 3 additions & 3 deletions internal/reader/icon/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ func (f *IconFinder) DownloadIcon(iconURL string) (*model.Icon, error) {

response, err := clt.Get()
if err != nil {
return nil, fmt.Errorf("icon: unable to download iconURL: %v", err)
return nil, fmt.Errorf("icon: unable to download icon %s: %v", iconURL, err)
}

if response.HasServerFailure() {
return nil, fmt.Errorf("icon: unable to download icon: status=%d", response.StatusCode)
return nil, fmt.Errorf("icon: unable to download icon %s: status=%d", iconURL, response.StatusCode)
}

body, err := io.ReadAll(response.Body)
if err != nil {
return nil, fmt.Errorf("icon: unable to read downloaded icon: %v", err)
return nil, fmt.Errorf("icon: unable to read downloaded icon from %s: %v", iconURL, err)
}

if len(body) == 0 {
Expand Down

0 comments on commit 5ac3489

Please sign in to comment.