push file offered notification when initial HTTP HEAD req. fails

This commit is contained in:
Daniel Gultsch 2016-07-21 19:17:26 +02:00
parent c8188ee52c
commit e9c00c0427

View file

@ -146,7 +146,6 @@ public class HttpDownloadConnection implements Transferable {
} }
private void showToastForException(Exception e) { private void showToastForException(Exception e) {
e.printStackTrace();
if (e instanceof java.net.UnknownHostException) { if (e instanceof java.net.UnknownHostException) {
mXmppConnectionService.showErrorToastInUi(R.string.download_failed_server_not_found); mXmppConnectionService.showErrorToastInUi(R.string.download_failed_server_not_found);
} else if (e instanceof java.net.ConnectException) { } else if (e instanceof java.net.ConnectException) {
@ -171,15 +170,14 @@ public class HttpDownloadConnection implements Transferable {
long size; long size;
try { try {
size = retrieveFileSize(); size = retrieveFileSize();
} catch (SSLHandshakeException e) { } catch (Exception e) {
changeStatus(STATUS_OFFER_CHECK_FILESIZE); 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()); Log.d(Config.LOGTAG, "io exception in http file size checker: " + e.getMessage());
if (interactive) { if (interactive) {
showToastForException(e); showToastForException(e);
} else {
HttpDownloadConnection.this.acceptedAutomatically = false;
HttpDownloadConnection.this.mXmppConnectionService.getNotificationService().push(message);
} }
cancel(); cancel();
return; return;
@ -250,6 +248,9 @@ public class HttpDownloadConnection implements Transferable {
} catch (Exception e) { } catch (Exception e) {
if (interactive) { if (interactive) {
showToastForException(e); showToastForException(e);
} else {
HttpDownloadConnection.this.acceptedAutomatically = false;
HttpDownloadConnection.this.mXmppConnectionService.getNotificationService().push(message);
} }
cancel(); cancel();
} }