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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 1033383002: Gracefully handle IO exceptions while resolving URIs (issue 23023) (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/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index f2f12c60282f4a9f0653caa106b9a31c1a6ad0f6..4ad8d0117230c61aa8738e7d60ada590934a264d 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -13,6 +13,7 @@ import 'dart:collection';
import 'package:analyzer/src/cancelable_future.dart';
import 'package:analyzer/src/generated/incremental_resolution_validator.dart';
+import 'package:analyzer/src/plugin/engine_plugin.dart';
import 'package:analyzer/src/services/lint.dart';
import 'package:analyzer/src/task/task_dart.dart';
@@ -35,7 +36,6 @@ import 'sdk.dart' show DartSdk;
import 'source.dart';
import 'utilities_collection.dart';
import 'utilities_general.dart';
-import 'package:analyzer/src/plugin/engine_plugin.dart';
/**
* Used by [AnalysisOptions] to allow function bodies to be analyzed in some
@@ -9402,10 +9402,14 @@ class ParseDartTask extends AnalysisTask {
UriValidationCode code = directive.validate();
if (code == null) {
String encodedUriContent = Uri.encodeFull(uriContent);
- Source source =
- context.sourceFactory.resolveUri(librarySource, encodedUriContent);
- directive.source = source;
- return source;
+ try {
+ Source source =
+ context.sourceFactory.resolveUri(librarySource, encodedUriContent);
+ directive.source = source;
+ return source;
+ } on JavaIOException {
+ code = UriValidationCode.INVALID_URI;
+ }
}
if (code == UriValidationCode.URI_WITH_DART_EXT_SCHEME) {
return null;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/engine_test.dart » ('j') | pkg/analyzer/test/generated/engine_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698