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

Unified Diff: pkg/analyzer/lib/src/task/general.dart

Issue 1041283002: GetContentTask should catch exceptions and wrap them into AnalysisExceptions. (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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/general_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/general.dart
diff --git a/pkg/analyzer/lib/src/task/general.dart b/pkg/analyzer/lib/src/task/general.dart
index 8e52537d92643df21bb94b6d4a379a172f29d461..8f883278ae176726cfcb1827e70f7c4495a54005 100644
--- a/pkg/analyzer/lib/src/task/general.dart
+++ b/pkg/analyzer/lib/src/task/general.dart
@@ -8,6 +8,7 @@ import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask;
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/task/general.dart';
import 'package:analyzer/task/model.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
/**
* A task that gets the contents of the source associated with an analysis
@@ -33,10 +34,14 @@ class GetContentTask extends SourceBasedAnalysisTask {
@override
internalPerform() {
Source source = getRequiredSource();
-
- TimestampedData<String> data = context.getContents(source);
- outputs[CONTENT] = data.data;
- outputs[MODIFICATION_TIME] = data.modificationTime;
+ try {
+ TimestampedData<String> data = context.getContents(source);
+ outputs[CONTENT] = data.data;
+ outputs[MODIFICATION_TIME] = data.modificationTime;
+ } catch (exception, stackTrace) {
+ throw new AnalysisException('Could not get contents of $source',
+ new CaughtException(exception, stackTrace));
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/general_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698