mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
catch potential exception (timeout) when subscribing
This commit is contained in:
@@ -17,6 +17,7 @@ import com.commafeed.backend.dao.FeedCategoryDAO;
|
|||||||
import com.commafeed.backend.model.FeedCategory;
|
import com.commafeed.backend.model.FeedCategory;
|
||||||
import com.commafeed.backend.model.User;
|
import com.commafeed.backend.model.User;
|
||||||
import com.commafeed.backend.services.FeedSubscriptionService;
|
import com.commafeed.backend.services.FeedSubscriptionService;
|
||||||
|
import com.commafeed.backend.services.FeedSubscriptionService.FeedSubscriptionException;
|
||||||
import com.sun.syndication.feed.opml.Opml;
|
import com.sun.syndication.feed.opml.Opml;
|
||||||
import com.sun.syndication.feed.opml.Outline;
|
import com.sun.syndication.feed.opml.Outline;
|
||||||
import com.sun.syndication.io.WireFeedInput;
|
import com.sun.syndication.io.WireFeedInput;
|
||||||
@@ -76,8 +77,16 @@ public class OPMLImporter {
|
|||||||
if (StringUtils.isBlank(title)) {
|
if (StringUtils.isBlank(title)) {
|
||||||
title = "Unnamed subscription";
|
title = "Unnamed subscription";
|
||||||
}
|
}
|
||||||
feedSubscriptionService.subscribe(user, outline.getXmlUrl(), title,
|
|
||||||
parent);
|
// make sure we continue with the import process even a feed failed
|
||||||
|
try {
|
||||||
|
feedSubscriptionService.subscribe(user, outline.getXmlUrl(), title,
|
||||||
|
parent);
|
||||||
|
} catch (FeedSubscriptionException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("error while importing {}: {}", outline.getXmlUrl(), e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user