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

Unified Diff: pkg/analysis_server/lib/src/domain_server.dart

Issue 187603010: gracefully degrade with response to client if fail to access client specified dart sdk (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: take 2 Created 6 years, 10 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 | « pkg/analysis_server/lib/src/analysis_manager.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/domain_server.dart
diff --git a/pkg/analysis_server/lib/src/domain_server.dart b/pkg/analysis_server/lib/src/domain_server.dart
index 1e37f24a69a38d6fdacc023419823dcae5cafa84..3924d1ad31a9fb9e16c37d21b4ee33d891b923b2 100644
--- a/pkg/analysis_server/lib/src/domain_server.dart
+++ b/pkg/analysis_server/lib/src/domain_server.dart
@@ -109,8 +109,16 @@ class ServerDomainHandler implements RequestHandler {
AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
// TODO(brianwilkerson) Use the information from the request to set the
// source factory in the context.
+ DirectoryBasedDartSdk sdk;
+ try {
+ sdk = new DirectoryBasedDartSdk(new JavaFile(sdkDirectory));
+ } on Exception catch (e) {
+ // TODO what error code should be returned here?
+ return new Response(request.id, new RequestError(
+ RequestError.CODE_SDK_ERROR, 'Failed to access sdk: $e'));
+ }
context.sourceFactory = new SourceFactory.con2([
- new DartUriResolver(new DirectoryBasedDartSdk(new JavaFile(sdkDirectory))),
+ new DartUriResolver(sdk),
new FileUriResolver(),
// new PackageUriResolver(),
]);
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_manager.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698