Skip to content

Commit

Permalink
fix: when img copy fails, keep going (#215)
Browse files Browse the repository at this point in the history
Addresses #192 but we still need to find out why the image fails to copy in the first place.
  • Loading branch information
marisademeglio authored and rdeltour committed Jul 8, 2019
1 parent a362050 commit f769b49
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/ace-report/src/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ module.exports = class Report {
return fs.pathExists(fromPath)
.then((exists) => {
if (exists) {
return fs.copy(fromPath, toPath, { overwrite: false });
return fs.copy(fromPath, toPath, { overwrite: false })
.catch(err => {
winston.warn(`Couldn't copy resource '${img.src}'. Error: ${err}`);
});
}
winston.warn(`Couldn’t copy resource '${img.src}'`);
winston.warn(`Couldn’t copy resource '${img.src}'. File does not exist.`);
return Promise.resolve();
});
}));
Expand Down

0 comments on commit f769b49

Please sign in to comment.