From 40d66b9b9a14cd65f36ccd13ae962058a9d9d4ca Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Sun, 15 Sep 2013 18:47:17 +0200 Subject: Do not retry loading a page after 404 from gc.com When a page cannot be found, geocaching.com returns with a 404. Retrying while logged in would not change anything, and we should not consider ourselves as logged as guest because of this error. --- main/src/cgeo/geocaching/network/Network.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main/src/cgeo/geocaching/network') diff --git a/main/src/cgeo/geocaching/network/Network.java b/main/src/cgeo/geocaching/network/Network.java index 873cfc9..1810216 100644 --- a/main/src/cgeo/geocaching/network/Network.java +++ b/main/src/cgeo/geocaching/network/Network.java @@ -399,6 +399,10 @@ public abstract class Network { return response != null && response.getStatusLine().getStatusCode() == 200; } + static public boolean isPageNotFound(@Nullable final HttpResponse response) { + return response != null && response.getStatusLine().getStatusCode() == 404; + } + /** * Get the result of a GET HTTP request returning a JSON body. * -- cgit v1.1