diff options
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadFile.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java index d3593700..4f79bdc9 100644 --- a/src/github/daneren2005/dsub/service/DownloadFile.java +++ b/src/github/daneren2005/dsub/service/DownloadFile.java @@ -30,6 +30,7 @@ import android.os.PowerManager; import android.util.DisplayMetrics; import android.util.Log; import github.daneren2005.dsub.domain.MusicDirectory; +import github.daneren2005.service.parser.SubsonicRESTException; import github.daneren2005.dsub.util.CancellableTask; import github.daneren2005.dsub.util.FileUtil; import github.daneren2005.dsub.util.Util; @@ -318,12 +319,20 @@ public class DownloadFile { } } + } catch(SubsonicRESTException x) { + Util.close(out); + Util.delete(completeFile); + Util.delete(saveFile); + if (!isCancelled()) { + failed++; + failedDownload = true; + Log.w(TAG, "Failed to download '" + song + "'.", x); + } } catch (Exception x) { Util.close(out); Util.delete(completeFile); Util.delete(saveFile); if (!isCancelled()) { - failed++; failedDownload = true; Log.w(TAG, "Failed to download '" + song + "'.", x); } |