catch potential exception (timeout) when subscribing

This commit is contained in:
Athou
2013-07-02 10:14:47 +02:00
parent 761946d2a3
commit b77077828e

View File

@@ -17,6 +17,7 @@ import com.commafeed.backend.dao.FeedCategoryDAO;
import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.User;
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.Outline;
import com.sun.syndication.io.WireFeedInput;
@@ -76,8 +77,16 @@ public class OPMLImporter {
if (StringUtils.isBlank(title)) {
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());
}
}
}
}