summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fetch/http.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/fetch/http.go b/fetch/http.go
index bd2ff7a..a93f8b7 100644
--- a/fetch/http.go
+++ b/fetch/http.go
@@ -19,6 +19,7 @@ import (
"time"
"github.com/mmcdole/gofeed"
+ "golang.nytpu.com/comitium/localizations"
"golang.nytpu.com/comitium/core"
)
@@ -42,7 +43,7 @@ func fetchHTTP(remoteURL string) (*http.Response, error) {
if resp.StatusCode != 200 {
resp.Body.Close()
- return nil, fmt.Errorf("Unexpected HTTP response %s", resp.Status)
+ return nil, fmt.Errorf(core.Localizer.Get("errors.http_bad_response", &localizations.Replacements{"status": resp.Status}))
}
return resp, nil
}
@@ -58,7 +59,7 @@ func httpFeed(data *core.FullData, remote string, title string) error {
if resp.Header.Get("Content-Type") == "text/html" {
// TODO
- return fmt.Errorf("Extracting feed from HTML pages is currently unsupported.")
+ return fmt.Errorf(core.Localizer.Get("errors.http_no_extract"))
}
reader := io.LimitReader(resp.Body, 1073741824) // 1 GiB