Throw actual error if file open fails in md5Async()

This commit is contained in:
Dan Stillman 2018-02-21 10:21:10 -05:00
parent 164fea0cec
commit 9cb2b8167d

View file

@ -190,11 +190,13 @@ Zotero.Utilities.Internal = {
var path = (file instanceof Components.interfaces.nsIFile) ? file.path : file;
var hash;
try {
file = await OS.File.open(path);
hash = await readChunk(file);
var osFile = await OS.File.open(path);
hash = await readChunk(osFile);
}
finally {
await file.close();
if (osFile) {
await osFile.close();
}
}
return hash;
},