summaryrefslogtreecommitdiffstats
path: root/lib/utils/page.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/page.js')
-rw-r--r--lib/utils/page.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js
index f24013f..fde2eaa 100644
--- a/lib/utils/page.js
+++ b/lib/utils/page.js
@@ -285,7 +285,13 @@ function convertImages(images, options) {
if (!image.origin && !_.contains(downloaded, image.origin)) return;
options.book.log.debug("download image", image.origin, "...");
downloaded.push(image.origin);
- return options.book.log.debug.promise(fs.writeStream(imgin, request(image.origin)));
+ return options.book.log.debug.promise(fs.writeStream(imgin, request(image.origin)))
+ .fail(function(err) {
+ if (!_.isError(err)) err = new Error(err);
+
+ err.message = 'Fail downloading '+image.origin+': '+err.message;
+ throw err;
+ });
})
// Write svg if content