From 26876bdbbf3dd05f19ebfd275ab87bfde9402485 Mon Sep 17 00:00:00 2001 From: Kristoffer Walker Date: Fri, 20 Apr 2012 15:22:18 -0400 Subject: [PATCH] propagate deep errors up callback chain On branch deep-error-reporting modified: lib/less/parser.js --- lib/less/parser.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index bb060fd6..27a0e5b9 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -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); }