Delete the partial download with any exception

Don't delete it if it doesn't exist.
This commit is contained in:
Max Howell 2009-09-17 16:20:20 +01:00
parent a7315fce20
commit 2149d9035a

View File

@ -39,8 +39,8 @@ class HttpDownloadStrategy <AbstractDownloadStrategy
unless @dl.exist? unless @dl.exist?
begin begin
curl @url, '-o', @dl curl @url, '-o', @dl
rescue rescue Exception
@dl.unlink @dl.unlink if @dl.exist?
raise raise
end end
else else