mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Simplify feed fetcher
- Add browser package to handle HTTP errors - Reduce code duplication
This commit is contained in:
parent
5870f04260
commit
778346b0b0
8 changed files with 275 additions and 186 deletions
|
@ -50,16 +50,16 @@ func (c *Controller) SubmitSubscription(w http.ResponseWriter, r *http.Request)
|
|||
return
|
||||
}
|
||||
|
||||
subscriptions, err := subscription.FindSubscriptions(
|
||||
subscriptions, findErr := subscription.FindSubscriptions(
|
||||
subscriptionForm.URL,
|
||||
subscriptionForm.UserAgent,
|
||||
subscriptionForm.Username,
|
||||
subscriptionForm.Password,
|
||||
)
|
||||
if err != nil {
|
||||
logger.Error("[Controller:SubmitSubscription] %v", err)
|
||||
if findErr != nil {
|
||||
logger.Error("[UI:SubmitSubscription] %s", findErr)
|
||||
v.Set("form", subscriptionForm)
|
||||
v.Set("errorMessage", err)
|
||||
v.Set("errorMessage", findErr)
|
||||
html.OK(w, r, v.Render("add_subscription"))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue