mirror of
https://github.com/less/less.js.git
synced 2026-01-23 14:18:00 -05:00
propagate deep errors up callback chain
On branch deep-error-reporting modified: lib/less/parser.js
This commit is contained in:
committed by
Luke Page
parent
66bbb9a44a
commit
26876bdbbf
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user