diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-07-21 19:17:26 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-07-21 19:17:26 +0200 |
commit | e9c00c0427cb3cb2d9347af69a150324a6a99a84 (patch) | |
tree | fd5641095070f9181b1409bdc090c9afaab20432 /src | |
parent | c8188ee52c1fc260e3710d835f518936eacc3a64 (diff) |
push file offered notification when initial HTTP HEAD req. fails
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java index f00a6cc5..3e2b1cad 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java @@ -146,7 +146,6 @@ public class HttpDownloadConnection implements Transferable { } private void showToastForException(Exception e) { - e.printStackTrace(); if (e instanceof java.net.UnknownHostException) { mXmppConnectionService.showErrorToastInUi(R.string.download_failed_server_not_found); } else if (e instanceof java.net.ConnectException) { @@ -171,15 +170,14 @@ public class HttpDownloadConnection implements Transferable { long size; try { size = retrieveFileSize(); - } catch (SSLHandshakeException e) { + } catch (Exception e) { changeStatus(STATUS_OFFER_CHECK_FILESIZE); - HttpDownloadConnection.this.acceptedAutomatically = false; - HttpDownloadConnection.this.mXmppConnectionService.getNotificationService().push(message); - return; - } catch (IOException e) { Log.d(Config.LOGTAG, "io exception in http file size checker: " + e.getMessage()); if (interactive) { showToastForException(e); + } else { + HttpDownloadConnection.this.acceptedAutomatically = false; + HttpDownloadConnection.this.mXmppConnectionService.getNotificationService().push(message); } cancel(); return; @@ -250,6 +248,9 @@ public class HttpDownloadConnection implements Transferable { } catch (Exception e) { if (interactive) { showToastForException(e); + } else { + HttpDownloadConnection.this.acceptedAutomatically = false; + HttpDownloadConnection.this.mXmppConnectionService.getNotificationService().push(message); } cancel(); } |