Skip to content

Commit

Permalink
Catching parse exception in mu.compile
Browse files Browse the repository at this point in the history
  • Loading branch information
farvilain committed Nov 4, 2014
1 parent 591f527 commit 38e820f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/mu.js
Expand Up @@ -37,9 +37,13 @@ mu.compile = function(filename, callback, unique) {
return callback(err);
}

parsed = parser.parse(contents);
mu.cache[filename] = [parsed, unique];
try{
parsed = parser.parse(contents);
}catch(e){
return callback(e);
}

mu.cache[filename] = [parsed, unique];
var i = 0;
(function next(err) {
if (err) {
Expand Down

0 comments on commit 38e820f

Please sign in to comment.