summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-07-10 07:09:30 +0200
committerSean Leonard <meanderingcode@aetherislands.net>2013-07-12 11:45:46 -0600
commitacdbbb68f2429986f96d94888c12a01883785170 (patch)
treeb2182b98c884cea821f2afb9510c920169b2326c /src
parentc95194cffd8ca59298f1eed78b73c8d5a7f4c537 (diff)
UnknownHostException separated from IOException.
I was treating the former exception simply as a kind of the latter, but user messages are different. Now, each one shows its different error message.
Diffstat (limited to 'src')
-rw-r--r--src/se/leap/leapclient/ProviderAPI.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/se/leap/leapclient/ProviderAPI.java b/src/se/leap/leapclient/ProviderAPI.java
index d0001b48..4f98e420 100644
--- a/src/se/leap/leapclient/ProviderAPI.java
+++ b/src/se/leap/leapclient/ProviderAPI.java
@@ -21,6 +21,7 @@ import java.net.SocketTimeoutException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
+import java.net.UnknownHostException;
import java.util.Scanner;
import javax.net.ssl.HostnameVerifier;
@@ -467,6 +468,8 @@ public class ProviderAPI extends IntentService {
} catch (CertificateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
+ } catch (UnknownHostException e) {
+ displayToast(R.string.server_is_down_message);
} catch (IOException e) {
// The downloaded certificate doesn't validate our https connection.
json_file_content = getStringFromProviderIgnoringCertificate(url);