1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Ensure that LocalizedError are returned by parsers

This commit is contained in:
Frédéric Guillot 2017-11-20 16:11:55 -08:00
parent 557cf9c21d
commit 0e6717b7c8
15 changed files with 71 additions and 30 deletions

View file

@ -6,10 +6,11 @@ package atom
import (
"encoding/xml"
"fmt"
"github.com/miniflux/miniflux2/model"
"io"
"github.com/miniflux/miniflux2/errors"
"github.com/miniflux/miniflux2/model"
"golang.org/x/net/html/charset"
)
@ -21,7 +22,7 @@ func Parse(data io.Reader) (*model.Feed, error) {
err := decoder.Decode(atomFeed)
if err != nil {
return nil, fmt.Errorf("Unable to parse Atom feed: %v\n", err)
return nil, errors.NewLocalizedError("Unable to parse Atom feed: %v", err)
}
return atomFeed.Transform(), nil