Fix for issue #1446: Compiler crashes on permissions error instead of giving meaningful error message

This commit is contained in:
Breckin Loggins
2011-07-18 14:29:45 -05:00
parent 5ee0254ce5
commit 2d54fea90c
2 changed files with 8 additions and 0 deletions

View File

@@ -90,6 +90,9 @@
if (stats.isDirectory()) {
return fs.readdir(source, function(err, files) {
var file, _k, _len3;
if (err) {
throw err;
}
unprocessed[sourceIndex] += files.length;
for (_k = 0, _len3 = files.length; _k < _len3; _k++) {
file = files[_k];
@@ -99,6 +102,9 @@
});
} else if (topLevel || path.extname(source) === '.coffee') {
fs.readFile(source, function(err, code) {
if (err) {
throw err;
}
unprocessed[sourceIndex] -= 1;
if (opts.join) {
contents[sourceIndex] = helpers.compact([contents[sourceIndex], code.toString()]).join('\n');