diff options
author | anekos | 2009-12-03 13:22:10 +0000 |
---|---|---|
committer | anekos | 2009-12-03 13:22:10 +0000 |
commit | e0055e6a0f8ef679ea34c7cb65128d374482f7c7 (patch) | |
tree | efe4e798c76bcaa032038a53b5d5db8b3bdac52e /zip-de-download.js | |
parent | 7e36e157bbe1f0aab153b23f1bcfd7312152f54e (diff) | |
download | vimperator-plugins-e0055e6a0f8ef679ea34c7cb65128d374482f7c7.tar.bz2 |
途中でダウンロードが中断してしまうのに対処
ただし、エラーをちゃんとすべきかも。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36064 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'zip-de-download.js')
-rw-r--r-- | zip-de-download.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/zip-de-download.js b/zip-de-download.js index 8e642d3..4f7cc8a 100644 --- a/zip-de-download.js +++ b/zip-de-download.js @@ -1,5 +1,5 @@ let INFO = -<plugin name="zip-de-download" version="0.5.1" +<plugin name="zip-de-download" version="0.5.2" href="" summary="ZIPでダウンロードするお" xmlns="http://vimperator.org/namespaces/liberator"> @@ -177,10 +177,15 @@ __proto__ = (function(){ let i = 0; for each(let url in urls){ let ch = createChannel(url); - let stream = ch.open(); - let entryName = ("000" + ++i).slice(-3) +"-"+ getEntryName(ch.URI, ch.contentType); - liberator.echomsg("zip: " + url + " to " + entryName, 3); - zipW.addEntryStream(entryName, Date.now() * 1000, Ci.nsIZipWriter.COMPRESSION_DEFAULT, stream, false); + try { + let stream = ch.open(); + let entryName = ("000" + ++i).slice(-3) +"-"+ getEntryName(ch.URI, ch.contentType); + liberator.echomsg("zip: " + url + " to " + entryName, 3); + zipW.addEntryStream(entryName, Date.now() * 1000, Ci.nsIZipWriter.COMPRESSION_DEFAULT, stream, false); + } catch (e) { + // XXX エラー分を通知すべき? + liberator.log('zip-de-download: error: ' + e); + } } zipW.close(); return zipFile; |