Chromium Code Reviews| Index: dart/lib/dartdoc/dartdoc.dart |
| diff --git a/dart/lib/dartdoc/dartdoc.dart b/dart/lib/dartdoc/dartdoc.dart |
| index 57191283f9718f3c214726e17a676fc2e7f09cf6..88a6c22ba3baa8e07bca7775b612c5a454163ded 100644 |
| --- a/dart/lib/dartdoc/dartdoc.dart |
| +++ b/dart/lib/dartdoc/dartdoc.dart |
| @@ -175,17 +175,27 @@ void copyFiles(String from, String to) { |
| */ |
| void compileScript(String compilerPath, String libDir, |
| String dartPath, String jsPath) { |
| - final process = new Process.start(compilerPath, [ |
| - '--libdir=$libDir', '--out=$jsPath', |
| - '--compile-only', '--enable-type-checks', '--warnings-as-errors', |
| - dartPath]); |
| + onExit(int exitCode, String stdout, String stderr) { |
| + if (exitCode != 0) { |
| + final message = 'Non-zero exit code from $compilerPath'; |
| + print('$message.'); |
|
Bob Nystrom
2012/04/24 16:03:58
This is a bit strange. Why not just put the "." in
ahe
2012/04/25 08:26:55
I'm not sure how to format exception messages: Sho
Bob Nystrom
2012/04/25 18:03:41
I'd say whatever initially creates the exception m
|
| + print(stdout); |
| + print(stderr); |
| + throw message; |
| + } |
| + } |
| - process.stdout.pipe(stdout, close: false); |
| + onError(error) { |
| + final message = 'Error trying to execute $compilerPath. Error: $error'; |
| + print('$message.'); |
| + throw message; |
| + } |
| - process.onError = (error) { |
| - print('Failed to compile $dartPath with $compilerPath. Error:'); |
| - print(error); |
| - }; |
| + print('Compiling $dartPath to $jsPath'); |
| + new Process.run(compilerPath, [ |
| + '--libdir=$libDir', '--out=$jsPath', |
| + '--compile-only', '--enable-type-checks', '--warnings-as-errors', |
| + dartPath], null, onExit).onError = onError; |
| } |
| class Dartdoc { |