1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Improve error handling for HTTP client

This commit is contained in:
Frédéric Guillot 2018-02-08 18:16:54 -08:00
parent 16c2dc4a8c
commit dda9114692
5 changed files with 62 additions and 7 deletions

View file

@ -33,6 +33,9 @@ func FindSubscriptions(websiteURL string) (Subscriptions, error) {
client := http.NewClient(websiteURL)
response, err := client.Get()
if err != nil {
if _, ok := err.(errors.LocalizedError); ok {
return nil, err
}
return nil, errors.NewLocalizedError(errConnectionFailure, err)
}