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

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: 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/test/mocks.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..4e18a53d5687b4b56f0321d1dc11914e527db5e2 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?
Brian Wilkerson 2014/03/05 22:48:09 We should probably create a new error code to indi
danrubel 2014/03/05 23:27:13 Done.
+ return new Response(request.id, new RequestError(
+ RequestError.CODE_INTERNAL_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/test/mocks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698