warn if we are unable to parse xml, debug otherwise (timeout, ...)

This commit is contained in:
Athou
2013-04-25 17:28:08 +02:00
parent 2af55553a2
commit 69e9d05e0b

View File

@@ -14,8 +14,6 @@ import javax.transaction.SystemException;
import org.apache.commons.lang.mutable.MutableBoolean; import org.apache.commons.lang.mutable.MutableBoolean;
import org.apache.commons.lang.time.DateUtils; import org.apache.commons.lang.time.DateUtils;
import org.apache.http.client.HttpResponseException;
import org.apache.http.conn.ConnectTimeoutException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -23,6 +21,7 @@ import com.commafeed.backend.HttpGetter.NotModifiedException;
import com.commafeed.backend.model.Feed; import com.commafeed.backend.model.Feed;
import com.commafeed.backend.model.FeedEntry; import com.commafeed.backend.model.FeedEntry;
import com.commafeed.backend.services.FeedUpdateService; import com.commafeed.backend.services.FeedUpdateService;
import com.sun.syndication.io.FeedException;
public class FeedRefreshWorker { public class FeedRefreshWorker {
@@ -93,11 +92,10 @@ public class FeedRefreshWorker {
} catch (Exception e) { } catch (Exception e) {
message = "Unable to refresh feed " + feed.getUrl() + " : " message = "Unable to refresh feed " + feed.getUrl() + " : "
+ e.getMessage(); + e.getMessage();
if (e instanceof HttpResponseException if (e instanceof FeedException) {
|| e instanceof ConnectTimeoutException) { log.warn(e.getClass().getName() + " " + message);
log.debug(e.getClass().getName() + " " + message);
} else { } else {
log.info(e.getClass().getName() + " " + message); log.debug(e.getClass().getName() + " " + message);
} }
errorCount = feed.getErrorCount() + 1; errorCount = feed.getErrorCount() + 1;