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

Unified Diff: dart/pkg/compiler/lib/src/source_file_provider.dart

Issue 841653004: Recover from read errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42871 Created 5 years, 11 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
« no previous file with comments | « dart/pkg/compiler/lib/src/script.dart ('k') | dart/pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/compiler/lib/src/source_file_provider.dart
diff --git a/dart/pkg/compiler/lib/src/source_file_provider.dart b/dart/pkg/compiler/lib/src/source_file_provider.dart
index 978156c1baad0493fe0f728803b2cceda8f6f62f..f254a5edddbbad49bdd282809f25429dde452eb8 100644
--- a/dart/pkg/compiler/lib/src/source_file_provider.dart
+++ b/dart/pkg/compiler/lib/src/source_file_provider.dart
@@ -53,9 +53,13 @@ abstract class SourceFileProvider {
try {
source = readAll(resourceUri.toFilePath());
} on FileSystemException catch (ex) {
+ OSError ose = ex.osError;
+ String detail = (ose != null && ose.message != null)
+ ? ' (${ose.message})'
+ : '';
return new Future.error(
- "Error reading '${relativize(cwd, resourceUri, isWindows)}' "
- "(${ex.osError})");
+ "Error reading '${relativize(cwd, resourceUri, isWindows)}'"
+ "$detail");
}
dartCharactersRead += source.length;
sourceFiles[resourceUri.toString()] =
@@ -203,8 +207,9 @@ class FormattingDiagnosticHandler {
print(file.getLocationMessage(
color(message), begin, end, colorize: color));
} else {
- print('${provider.relativizeUri(uri)}@$begin+${end - begin}:'
- ' [$kind] ${color(message)}');
+ String position = end - begin > 0 ? '@$begin+${end - begin}' : '';
+ print('${provider.relativizeUri(uri)}$position:\n'
+ '${color(message)}');
}
}
if (fatal && ++fatalCount >= throwOnErrorCount && throwOnError) {
« no previous file with comments | « dart/pkg/compiler/lib/src/script.dart ('k') | dart/pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698