Throw correct error in configuration

This commit is contained in:
Samy Pessé
2015-09-20 23:27:39 +02:00
parent c372dfc544
commit 813210bf47
+1 -1
View File
@@ -115,7 +115,7 @@ Configuration.prototype.load = function() {
})
.then(function() {
if (!semver.satisfies(pkg.version, that.options.gitbook)) {
throw "GitBook version doesn't satisfy version required by the book: "+that.options.gitbook;
throw new Error("GitBook version doesn't satisfy version required by the book: "+that.options.gitbook);
}
if (that.options.gitbook != "*" && !semver.satisfies(semver.inc(pkg.version, "patch"), that.options.gitbook)) {
that.book.log.warn.ln("gitbook version specified in your book.json might be too strict for future patches, \""+(_.first(pkg.version.split("."))+".x.x")+"\" is more adequate");