1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Add new API endpoint /icons/{iconID}

This commit is contained in:
Frédéric Guillot 2023-10-05 22:23:29 -07:00
parent 5774323f2e
commit 2002d60fbe
6 changed files with 62 additions and 10 deletions

View file

@ -27,7 +27,7 @@ func (s *Storage) IconByID(iconID int64) (*model.Icon, error) {
if err == sql.ErrNoRows {
return nil, nil
} else if err != nil {
return nil, fmt.Errorf("store: unable to fetch icon by hash: %v", err)
return nil, fmt.Errorf("store: unable to fetch icon #%d: %w", iconID, err)
}
return &icon, nil
@ -63,7 +63,7 @@ func (s *Storage) IconByHash(icon *model.Icon) error {
if err == sql.ErrNoRows {
return nil
} else if err != nil {
return fmt.Errorf(`store: unable to fetch icon by hash: %v`, err)
return fmt.Errorf(`store: unable to fetch icon by hash %q: %v`, icon.Hash, err)
}
return nil