diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-19 21:02:44 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-19 21:02:44 -0800 |
commit | 2f3cb58579bbca6645b144de339b73c19f37abed (patch) | |
tree | 93d1bde7f3072c9e8eeeaad11cda39600e480e63 /tools | |
parent | ca9cbdb7c5b72b12439686f5bf56d939a6001311 (diff) |
better error handling for problems in js optimizer and eliminator
Diffstat (limited to 'tools')
-rw-r--r-- | tools/shared.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py index 4e87269b..5b238aa4 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -563,7 +563,8 @@ class Building: if type(passes) == str: passes = [passes] input = open(filename, 'r').read() - output = Popen([NODE_JS, JS_OPTIMIZER] + passes, stdin=PIPE, stdout=PIPE).communicate(input)[0] + output, err = Popen([NODE_JS, JS_OPTIMIZER] + passes, stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate(input) + assert len(output) > 0, 'Error in js optimizer: ' + err + '\n\n' + output filename += '.jo.js' f = open(filename, 'w') f.write(output) @@ -578,7 +579,8 @@ class Building: coffee = path_from_root('tools', 'eliminator', 'node_modules', 'coffee-script', 'bin', 'coffee') eliminator = path_from_root('tools', 'eliminator', 'eliminator.coffee') input = open(filename, 'r').read() - output = Popen([coffee, eliminator], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate(input)[0] + output, err = Popen([coffee, eliminator], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate(input) + assert len(output) > 0, 'Error in eliminator: ' + err + '\n\n' + output filename += '.el.js' f = open(filename, 'w') f.write(output) |