Chromium Code Reviews| Index: pkg/docgen/lib/src/generator.dart |
| diff --git a/pkg/docgen/lib/src/generator.dart b/pkg/docgen/lib/src/generator.dart |
| index aba05514e1376b6bf71c8a944fd8ac1621624250..09293f9a93b13be3d281630a521bf990fb572a28 100644 |
| --- a/pkg/docgen/lib/src/generator.dart |
| +++ b/pkg/docgen/lib/src/generator.dart |
| @@ -136,8 +136,15 @@ void _writeToFile(String text, String filename) { |
| var parentDir = new Directory(path.dirname(filePath)); |
| if (!parentDir.existsSync()) parentDir.createSync(recursive: true); |
| - new File(filePath) |
| - .writeAsStringSync(text, mode: FileMode.WRITE); |
| + try { |
| + new File(filePath) |
| + .writeAsStringSync(text, mode: FileMode.WRITE); |
| + } on FileSystemException catch (e) { |
| + print('Failed to write to the path $filePath. Do you have write ' |
| + 'permissions to that directory? If not, please specifi a different ' |
|
kevmoo
2014/05/09 00:24:02
specify
|
| + 'output directory using the --out option.'); |
| + exit(1); |
| + } |
| } |
| /// Resolve all the links in the introductory comments for a given library or |