From f769b49750dc1fb85da5b8ce8024329c0ee1b6d9 Mon Sep 17 00:00:00 2001 From: Marisa DeMeglio Date: Mon, 8 Jul 2019 06:48:57 -0700 Subject: [PATCH] fix: when img copy fails, keep going (#215) Addresses #192 but we still need to find out why the image fails to copy in the first place. --- packages/ace-report/src/report.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ace-report/src/report.js b/packages/ace-report/src/report.js index d3d12514..f24091dc 100644 --- a/packages/ace-report/src/report.js +++ b/packages/ace-report/src/report.js @@ -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(); }); }));