aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-02-27 21:19:59 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-02-27 21:19:59 -0800
commitf110384f113002ad022c677ea138a0f77fad4a62 (patch)
tree059d6a98b636715855aa13c7512c103c447c865c /reader
parent953d0a2dc05714c22f7c9c389a860fd38c07b66e (diff)
Improve parser error messages
Diffstat (limited to 'reader')
-rw-r--r--reader/atom/parser.go2
-rw-r--r--reader/feed/handler.go2
-rw-r--r--reader/json/parser.go2
-rw-r--r--reader/opml/parser.go2
-rw-r--r--reader/rdf/parser.go2
-rw-r--r--reader/rss/parser.go2
6 files changed, 6 insertions, 6 deletions
diff --git a/reader/atom/parser.go b/reader/atom/parser.go
index 9a41dac..d560c27 100644
--- a/reader/atom/parser.go
+++ b/reader/atom/parser.go
@@ -21,7 +21,7 @@ func Parse(data io.Reader) (*model.Feed, *errors.LocalizedError) {
err := decoder.Decode(atomFeed)
if err != nil {
- return nil, errors.NewLocalizedError("Unable to parse Atom feed: %v.", err)
+ return nil, errors.NewLocalizedError("Unable to parse Atom feed: %q", err)
}
return atomFeed.Transform(), nil
diff --git a/reader/feed/handler.go b/reader/feed/handler.go
index 516593c..da02e99 100644
--- a/reader/feed/handler.go
+++ b/reader/feed/handler.go
@@ -24,7 +24,7 @@ var (
errServerFailure = "Unable to fetch feed (statusCode=%d)"
errDuplicate = "This feed already exists (%s)"
errNotFound = "Feed %d not found"
- errEncoding = "Unable to normalize encoding: %v"
+ errEncoding = "Unable to normalize encoding: %q"
errCategoryNotFound = "Category not found for this user"
errEmptyFeed = "This feed is empty"
)
diff --git a/reader/json/parser.go b/reader/json/parser.go
index ddd3e4f..55c9372 100644
--- a/reader/json/parser.go
+++ b/reader/json/parser.go
@@ -17,7 +17,7 @@ func Parse(data io.Reader) (*model.Feed, *errors.LocalizedError) {
feed := new(jsonFeed)
decoder := json.NewDecoder(data)
if err := decoder.Decode(&feed); err != nil {
- return nil, errors.NewLocalizedError("Unable to parse JSON Feed: %v", err)
+ return nil, errors.NewLocalizedError("Unable to parse JSON Feed: %q", err)
}
return feed.Transform(), nil
diff --git a/reader/opml/parser.go b/reader/opml/parser.go
index b167d47..93f2f25 100644
--- a/reader/opml/parser.go
+++ b/reader/opml/parser.go
@@ -20,7 +20,7 @@ func Parse(data io.Reader) (SubcriptionList, *errors.LocalizedError) {
err := decoder.Decode(feeds)
if err != nil {
- return nil, errors.NewLocalizedError("Unable to parse OPML file: %v.", err)
+ return nil, errors.NewLocalizedError("Unable to parse OPML file: %q", err)
}
return feeds.Transform(), nil
diff --git a/reader/rdf/parser.go b/reader/rdf/parser.go
index 06cacec..76b731c 100644
--- a/reader/rdf/parser.go
+++ b/reader/rdf/parser.go
@@ -21,7 +21,7 @@ func Parse(data io.Reader) (*model.Feed, *errors.LocalizedError) {
err := decoder.Decode(feed)
if err != nil {
- return nil, errors.NewLocalizedError("Unable to parse RDF feed: %v.", err)
+ return nil, errors.NewLocalizedError("Unable to parse RDF feed: %q", err)
}
return feed.Transform(), nil
diff --git a/reader/rss/parser.go b/reader/rss/parser.go
index 328cde2..709f8ff 100644
--- a/reader/rss/parser.go
+++ b/reader/rss/parser.go
@@ -21,7 +21,7 @@ func Parse(data io.Reader) (*model.Feed, *errors.LocalizedError) {
err := decoder.Decode(feed)
if err != nil {
- return nil, errors.NewLocalizedError("Unable to parse RSS feed: %v.", err)
+ return nil, errors.NewLocalizedError("Unable to parse RSS feed: %q", err)
}
return feed.Transform(), nil