X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fgofetch%2FFetcher.java;h=258f1961e58b8746b8286f7131726d2e9de659d3;hb=26816d976f9d888fbf75feb754d761871a988c69;hp=5f81edabcb887cdb9e211c558331bab8a78339ec;hpb=136ab80122a17caa0720116d6d2552521239fbb3;p=gofetch.git
diff --git a/src/be/nikiroo/gofetch/Fetcher.java b/src/be/nikiroo/gofetch/Fetcher.java
index 5f81eda..258f196 100644
--- a/src/be/nikiroo/gofetch/Fetcher.java
+++ b/src/be/nikiroo/gofetch/Fetcher.java
@@ -42,8 +42,8 @@ public class Fetcher {
* the sub directory and (pre-)selector to use for the resources
* (will have an impact on the files' content)
* @param type
- * the type of news to get (or the special keyword ALL to get all
- * of the supported sources)
+ * the type of news to get (or NULL to get all of the supported
+ * sources)
* @param maxStories
* the maximum number of stories to show on the resume page
* @param hostname
@@ -81,7 +81,12 @@ public class Fetcher {
BasicSupport support = BasicSupport.getSupport(type);
if (type == this.type || this.type == null) {
- list(support);
+ try {
+ list(support);
+ } catch (Exception e) {
+ new Exception("Failed to process support: " + type, e)
+ .printStackTrace();
+ }
}
gopherBuilder.append(getLink(support.getDescription(),
@@ -142,12 +147,20 @@ public class Fetcher {
// Get comments (and update stories if needed):
int i = 1;
+ List fetchedStories = new ArrayList(stories.size());
for (Story story : stories) {
- System.err.println(String.format("%02d/%02d", i, stories.size())
+ System.err.print(String.format("%02d/%02d", i, stories.size())
+ " Fetching full story " + story.getId() + "...");
- support.fetch(story);
+ try {
+ support.fetch(story);
+ fetchedStories.add(story);
+ System.err.println();
+ } catch (IOException e) {
+ System.err.println(" Failed to get story!");
+ }
i++;
}
+ stories = fetchedStories;
Output gopher = new Gopher(support.getType(), hostname, preselector,
port);