propagate deep errors up callback chain

On branch deep-error-reporting

	modified:   lib/less/parser.js
This commit is contained in:
Kristoffer Walker
2012-04-20 15:22:18 -04:00
committed by Luke Page
parent 66bbb9a44a
commit 26876bdbbf

View File

@@ -99,7 +99,7 @@ less.Parser = function Parser(env) {
callback(e, root, imported);
if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing
if (that.queue.length === 0) { finish(e) } // Call `finish` if we're done importing
}, env);
}
};
@@ -431,7 +431,10 @@ less.Parser = function Parser(env) {
}
if (this.imports.queue.length > 0) {
finish = function () { callback(error, root) };
finish = function (e) {
if (e) callback(e);
else callback(null, root);
};
} else {
callback(error, root);
}