aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2014-04-11 10:04:23 -0700
committerdaneren2005 <daneren2005@gmail.com>2014-04-11 10:04:23 -0700
commit9f87e456e2bc77931a10acdc038a945be1cc5359 (patch)
tree48c58503be65929cba078fb140f1f16163e11c02 /src/github/daneren2005
parent6ae517ac936d6d52660e078eb5994bfc35a01c5f (diff)
downloaddsub-9f87e456e2bc77931a10acdc038a945be1cc5359.tar.gz
dsub-9f87e456e2bc77931a10acdc038a945be1cc5359.tar.bz2
dsub-9f87e456e2bc77931a10acdc038a945be1cc5359.zip
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.
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadFile.java12
1 files 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);