summaryrefslogtreecommitdiff
path: root/fetch
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-05-11 15:19:08 -0600
committernytpu <alex@nytpu.com>2021-05-11 15:19:08 -0600
commit45d04c35ace62dea934ef845fdebda7cd44a9563 (patch)
tree69b254e8e9606f1662e3e5c11111872753f2cae7 /fetch
parent21333c60852cf9f56dead7644f2fa97a7e601cdd (diff)
translate http.go
Diffstat (limited to 'fetch')
-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