1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-26 18:21:01 +00:00

Refactor HTTP Client and LocalizedError packages

This commit is contained in:
Frédéric Guillot 2023-10-21 19:50:29 -07:00
parent 120aabfbce
commit 14e25ab9fe
104 changed files with 1277 additions and 10672 deletions

View file

@ -32,7 +32,7 @@ func (h *handler) discoverSubscriptions(w http.ResponseWriter, r *http.Request)
rssbridgeURL = intg.RSSBridgeURL
}
subscriptions, finderErr := subscription.FindSubscriptions(
subscriptions, localizedError := subscription.FindSubscriptions(
subscriptionDiscoveryRequest.URL,
subscriptionDiscoveryRequest.UserAgent,
subscriptionDiscoveryRequest.Cookie,
@ -42,12 +42,13 @@ func (h *handler) discoverSubscriptions(w http.ResponseWriter, r *http.Request)
subscriptionDiscoveryRequest.AllowSelfSignedCertificates,
rssbridgeURL,
)
if finderErr != nil {
json.ServerError(w, r, finderErr)
if localizedError != nil {
json.ServerError(w, r, localizedError.Error())
return
}
if subscriptions == nil {
if len(subscriptions) == 0 {
json.NotFound(w, r)
return
}