Throw actual error if file open fails in md5Async()
This commit is contained in:
parent
164fea0cec
commit
9cb2b8167d
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue