diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java index 39249c655..7d58cde07 100644 --- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java +++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java @@ -406,7 +406,9 @@ public class HttpDownloadConnection implements Transferable { long reportedContentLengthOnGet; try { reportedContentLengthOnGet = Long.parseLong(connection.getHeaderField("Content-Length")); - } catch (NumberFormatException | NullPointerException e) { + } catch (NumberFormatException e) { + reportedContentLengthOnGet = 0; + } catch (NullPointerException e) { reportedContentLengthOnGet = 0; } if (expected != reportedContentLengthOnGet) { @@ -437,7 +439,10 @@ public class HttpDownloadConnection implements Transferable { } catch (IOException e) { throw new FileWriterException(); } - } catch (CancellationException | IOException e) { + } catch (CancellationException e) { + Log.d(Config.LOGTAG, "http download failed " + e.getMessage()); + throw e; + } catch (IOException e) { Log.d(Config.LOGTAG, "http download failed " + e.getMessage()); throw e; } finally { |