Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Unified Diff: pkg/analyzer/lib/file_system/physical_file_system.dart

Issue 989393002: Wrap dart:io exception in getChildren(), implement for the memory FS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/file_system/physical_file_system.dart
diff --git a/pkg/analyzer/lib/file_system/physical_file_system.dart b/pkg/analyzer/lib/file_system/physical_file_system.dart
index 71c40203f74d8c2dad65a7e08f86cfcf989afe11..edec1ae6dfc99f7d78c931feaf89b9a6ce1e4efa 100644
--- a/pkg/analyzer/lib/file_system/physical_file_system.dart
+++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
@@ -80,7 +80,7 @@ class _PhysicalFile extends _PhysicalResource implements File {
io.File file = _entry as io.File;
return file.lastModifiedSync().millisecondsSinceEpoch;
} on io.FileSystemException catch (exception) {
- throw new FileSystemException(path, exception.message);
+ throw new FileSystemException(exception.path, exception.message);
}
}
@@ -134,19 +134,23 @@ class _PhysicalFolder extends _PhysicalResource implements Folder {
@override
List<Resource> getChildren() {
- List<Resource> children = <Resource>[];
- io.Directory directory = _entry as io.Directory;
- List<io.FileSystemEntity> entries = directory.listSync(recursive: false);
- int numEntries = entries.length;
- for (int i = 0; i < numEntries; i++) {
- io.FileSystemEntity entity = entries[i];
- if (entity is io.Directory) {
- children.add(new _PhysicalFolder(entity));
- } else if (entity is io.File) {
- children.add(new _PhysicalFile(entity));
+ try {
+ List<Resource> children = <Resource>[];
+ io.Directory directory = _entry as io.Directory;
+ List<io.FileSystemEntity> entries = directory.listSync(recursive: false);
+ int numEntries = entries.length;
+ for (int i = 0; i < numEntries; i++) {
+ io.FileSystemEntity entity = entries[i];
+ if (entity is io.Directory) {
+ children.add(new _PhysicalFolder(entity));
+ } else if (entity is io.File) {
+ children.add(new _PhysicalFile(entity));
+ }
}
+ return children;
+ } on io.FileSystemException catch (exception) {
+ throw new FileSystemException(exception.path, exception.message);
}
- return children;
}
@override
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/test/file_system/memory_file_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698