From acdbbb68f2429986f96d94888c12a01883785170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Wed, 10 Jul 2013 07:09:30 +0200 Subject: 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. --- src/se/leap/leapclient/ProviderAPI.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/se/leap/leapclient/ProviderAPI.java') diff --git a/src/se/leap/leapclient/ProviderAPI.java b/src/se/leap/leapclient/ProviderAPI.java index d0001b4..4f98e42 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); -- cgit v1.2.3