Add path to zip to the error message of loadFileFromZipEntries
@@ -106,7 +106,7 @@ export default class LinkOverlay extends React.Component {
}`;
if (zipPath in zipEntriesCache) {
- this.loadFileFromZipEntries(zipEntriesCache[zipPath], zipFile);
+ this.loadFileFromZipEntries(zipEntriesCache[zipPath], zipFile, zipPath);
} else {
this.readZipArchive(zipPath, zipFile);
}
@@ -177,18 +177,18 @@ export default class LinkOverlay extends React.Component {
loadFileFromZipArchive = (zipReader, zipFile, zipPath) => {
zipReader.getEntries(entries => {
zipEntriesCache[zipPath] = entries;
- this.loadFileFromZipEntries(entries, zipFile);
+ this.loadFileFromZipEntries(entries, zipFile, zipPath);
});
};
- loadFileFromZipEntries(entries, zipFile) {
+ loadFileFromZipEntries(entries, zipFile, zipPath) {
const entry = entries.find(entry => entry.filename === zipFile);
if (entry) {
entry.getData(new zip.TextWriter(), content =>
this.setState({ content }),
);
} else {
- this.setError(`Could not find the file "${zipFile}"`);
+ this.setError(`Could not find the file "${zipFile}" in "${zipPath}"`);
}
}
