mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 23:55:20 +00:00
Improve error message when imagemagick is not installed
This commit is contained in:
+8
-1
@@ -18,7 +18,14 @@ var convert = function(source, dest, options) {
|
||||
if (options.resize) img = img.resize(options.resize.w, options.resize.h);
|
||||
|
||||
img.noProfile()
|
||||
.write(dest, d.makeNodeResolver());
|
||||
.write(dest, function(err) {
|
||||
if (!err) return d.resolve();
|
||||
|
||||
if (err.code == "ENOENT") {
|
||||
err = new Error("Need to install 'ImageMagick'");
|
||||
}
|
||||
d.reject(err);
|
||||
});
|
||||
|
||||
return d.promise;
|
||||
};
|
||||
|
||||
+2
-1
@@ -155,8 +155,9 @@ function convertImages(images, options) {
|
||||
return imgUtils.convert(imgin, imgout)
|
||||
.then(function() {
|
||||
options.book.log.debug.ok();
|
||||
}, function() {
|
||||
}, function(err) {
|
||||
options.book.log.debug.fail();
|
||||
throw err;
|
||||
});
|
||||
});
|
||||
}, Q());
|
||||
|
||||
Reference in New Issue
Block a user