Throw actual error if file open fails in md5Async()
This commit is contained in:
parent
164fea0cec
commit
9cb2b8167d
|
@ -190,11 +190,13 @@ Zotero.Utilities.Internal = {
|
||||||
var path = (file instanceof Components.interfaces.nsIFile) ? file.path : file;
|
var path = (file instanceof Components.interfaces.nsIFile) ? file.path : file;
|
||||||
var hash;
|
var hash;
|
||||||
try {
|
try {
|
||||||
file = await OS.File.open(path);
|
var osFile = await OS.File.open(path);
|
||||||
hash = await readChunk(file);
|
hash = await readChunk(osFile);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
await file.close();
|
if (osFile) {
|
||||||
|
await osFile.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return hash;
|
return hash;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user