Index: pkg/front_end/lib/physical_file_system.dart |
diff --git a/pkg/front_end/lib/physical_file_system.dart b/pkg/front_end/lib/physical_file_system.dart |
index a81a44dfea7c9850aebde4edd92e6e6e8543aa54..b00ad8c79b35f7713ba207bc93c8ec220d4fb2f4 100644 |
--- a/pkg/front_end/lib/physical_file_system.dart |
+++ b/pkg/front_end/lib/physical_file_system.dart |
@@ -43,12 +43,6 @@ class _PhysicalFileSystemEntity implements FileSystemEntity { |
other is _PhysicalFileSystemEntity && other.uri == uri; |
@override |
- Future<List<int>> readAsBytes() => new io.File.fromUri(uri).readAsBytes(); |
- |
- @override |
- Future<String> readAsString() => new io.File.fromUri(uri).readAsString(); |
- |
- @override |
Future<bool> exists() async { |
if (await io.FileSystemEntity.isFile(uri.toFilePath())) { |
return new io.File.fromUri(uri).exists(); |
@@ -58,5 +52,29 @@ class _PhysicalFileSystemEntity implements FileSystemEntity { |
} |
@override |
- Future<DateTime> lastModified() => new io.File.fromUri(uri).lastModified(); |
+ Future<DateTime> lastModified() async { |
+ try { |
+ return await new io.File.fromUri(uri).lastModified(); |
+ } on io.FileSystemException catch (exception) { |
+ throw new FileSystemException(uri, exception.message); |
Paul Berry
2017/05/07 14:06:49
The logic you're removing from pkg/front_end/lib/s
scheglov
2017/05/07 15:55:25
Done.
|
+ } |
+ } |
+ |
+ @override |
+ Future<List<int>> readAsBytes() async { |
+ try { |
+ return await new io.File.fromUri(uri).readAsBytes(); |
+ } on io.FileSystemException catch (exception) { |
+ throw new FileSystemException(uri, exception.message); |
+ } |
+ } |
+ |
+ @override |
+ Future<String> readAsString() async { |
+ try { |
+ return await new io.File.fromUri(uri).readAsString(); |
+ } on io.FileSystemException catch (exception) { |
+ throw new FileSystemException(uri, exception.message); |
+ } |
+ } |
} |