aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-07-21 19:17:26 +0200
committerChristian Schneppe <christian@pix-art.de>2016-07-25 19:45:52 +0200
commit484068e14349d9e00879c6028f616729e66e4229 (patch)
treea447efad84d3df7e130eda45edb00e73427f6b2d /src/main/java/eu/siacs
parent0b26f27c6b239c6819ebeece84d7fd1a578f49f3 (diff)
push file offered notification when initial HTTP HEAD req. fails
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java13
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 6f141aa86..59116d993 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
@@ -152,7 +152,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) {
@@ -177,15 +176,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;
@@ -259,6 +257,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();
}