diff options
Diffstat (limited to 'src/se')
-rw-r--r-- | src/se/leap/leapclient/ProviderAPI.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/se/leap/leapclient/ProviderAPI.java b/src/se/leap/leapclient/ProviderAPI.java index d41d7662..dc0b2aa6 100644 --- a/src/se/leap/leapclient/ProviderAPI.java +++ b/src/se/leap/leapclient/ProviderAPI.java @@ -17,6 +17,7 @@ package se.leap.leapclient; import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; @@ -418,6 +419,9 @@ public class ProviderAPI extends IntentService { displayToast(R.string.malformed_url); } catch(SocketTimeoutException e) { displayToast(R.string.server_is_down_message); + } catch (FileNotFoundException e) { + e.printStackTrace(); + displayToast(R.string.server_is_down_message); } catch (IOException e) { if(provider_url != null) { json_file_content = getStringFromProviderWithCACertAdded(provider_url, danger_on); @@ -458,6 +462,9 @@ public class ProviderAPI extends IntentService { json_string = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next(); } catch (MalformedURLException e) { displayToast(R.string.malformed_url); + } catch (FileNotFoundException e) { + e.printStackTrace(); + displayToast(R.string.server_is_down_message); } catch (IOException e) { json_string = getStringFromProviderIgnoringCertificate(string_url); } @@ -510,6 +517,9 @@ public class ProviderAPI extends IntentService { e.printStackTrace(); } catch (UnknownHostException e) { displayToast(R.string.server_is_down_message); + } catch (FileNotFoundException e) { + e.printStackTrace(); + displayToast(R.string.server_is_down_message); } catch (IOException e) { // The downloaded certificate doesn't validate our https connection. if(danger_on) { @@ -563,6 +573,9 @@ public class ProviderAPI extends IntentService { }); string = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next(); System.out.println("String ignoring certificate = " + string); + } catch (FileNotFoundException e) { + e.printStackTrace(); + displayToast(R.string.server_is_down_message); } catch (IOException e) { // The downloaded certificate doesn't validate our https connection. e.printStackTrace(); |