Skip to content

Commit 0cd2d78

Browse files
author
tlrobinson
committed
Print compiler errors to stderr
1 parent be672eb commit 0cd2d78

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib-js/coffee-script.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ var coffeePath = FILE.path(module.path).dirname().dirname().join("bin", "coffee-
3434
exports.compileFile = function(path) {
3535
var coffee = OS.popen([coffeePath, "--print", "--no-wrap", path]);
3636

37-
if (coffee.wait() !== 0)
38-
throw new Error("coffee compiler error");
37+
if (coffee.wait() !== 0) {
38+
system.stderr.print(coffee.stderr.read());
39+
throw new Error("coffee-script compile error");
40+
}
3941

4042
return coffee.stdout.read();
4143
}
@@ -45,8 +47,10 @@ exports.compile = function(source) {
4547

4648
coffee.stdin.write(source).flush().close();
4749

48-
if (coffee.wait() !== 0)
49-
throw new Error("coffee compiler error");
50+
if (coffee.wait() !== 0) {
51+
system.stderr.print(coffee.stderr.read());
52+
throw new Error("coffee-script compile error");
53+
}
5054

5155
return coffee.stdout.read();
5256
}

0 commit comments

Comments
 (0)