From 9f87e456e2bc77931a10acdc038a945be1cc5359 Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Fri, 11 Apr 2014 10:04:23 -0700 Subject: Don't fail limit on IOException (network issue) During bad network connections, IOException can be thrown many times before the connection picks back up. Everything else needs to be fail limited though, not just SubsonicRESTException. --- src/github/daneren2005/dsub/service/DownloadFile.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java index 8a0ec781..d9adc1bf 100644 --- a/src/github/daneren2005/dsub/service/DownloadFile.java +++ b/src/github/daneren2005/dsub/service/DownloadFile.java @@ -423,27 +423,25 @@ public class DownloadFile implements BufferFile { } } - } catch(SubsonicRESTException x) { + } catch(InterruptedException x) { + throw x + } catch(IOException x) { Util.close(out); Util.delete(completeFile); Util.delete(saveFile); - if (!isCancelled()) { - failed++; + if(!isCancelled()) { failedDownload = true; Log.w(TAG, "Failed to download '" + song + "'.", x); } - } catch(InterruptedException x) { - throw x; } catch (Exception x) { Util.close(out); Util.delete(completeFile); Util.delete(saveFile); if (!isCancelled()) { - failed++; + failed++; failedDownload = true; Log.w(TAG, "Failed to download '" + song + "'.", x); } - } finally { Util.close(in); Util.close(out); -- cgit v1.2.3