Skip to content

Commit

Permalink
Better error reporting for download failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwdyer committed Feb 10, 2010
1 parent 7e4b1d5 commit fc34997
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ release
temp
etc/intellij/*.iws
*/build
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.fetcher.FeedFetcher;
import com.sun.syndication.fetcher.FetcherException;
import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -88,6 +89,10 @@ public List<Article> call() throws Exception
}
return feedArticles;
}
catch (FetcherException ex)
{
LOG.error("Failed fetching " + feedURL + ", " + ex.getMessage());
}
catch (UnknownHostException ex)
{
LOG.error("Failed fetching " + feedURL + ", unknown host.");
Expand Down
7 changes: 5 additions & 2 deletions core/src/java/main/org/uncommons/zeitgeist/Zeitgeist.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private List<Article> downloadArticles()
catch (ExecutionException ex)
{
// Log the failure for this feed, but carry on with other feeds.
ex.printStackTrace();
LOG.errorException(ex.getCause());
}
}
executor.shutdown();
Expand Down Expand Up @@ -214,7 +214,10 @@ private List<Topic> extractTopics(List<Article> articles,
else
{
String detail = topicArticles.isEmpty() ? "???" : topicArticles.get(0).getItem().getHeadline();
LOG.verbose(String.format("Discarding topic \"%s\" (%d), too few sources (%d)", detail, topicArticles.size(), sources));
LOG.verbose(String.format("Discarding topic \"%s\" (%d), too few sources (%d)",
detail,
topicArticles.size(),
sources));
}
}

Expand Down
2 changes: 1 addition & 1 deletion feedlists/football.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ http://www.goal.com/en/feeds/news?fmt=rss
http://www.thesun.co.uk/sol/homepage/feeds/rss/article247739.ece
http://feeds.teletext.co.uk/sport/football/stories
http://www.newsoftheworld.co.uk/feeds/rss/article186490.ece
http://www.uefa.com/rssfeed/footballeurope/index.xml
http://www.uefa.com/rssfeed/news/rss.xml
http://resources.sportingo.com/Sportingo_RSS/Section/Football.xml
http://www.express.co.uk/posts/rss/67/football
http://www.metro.co.uk/xml/rss/page.xml?in_page_id=43

0 comments on commit fc34997

Please sign in to comment.