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

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

Issue 214933002: Clean-up and progress on analysis server (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « pkg/analysis_server/lib/src/analysis_logger.dart ('k') | pkg/analysis_server/lib/src/channel.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index afd6affa953b04c3dd72f2d0436f09f9a6584770..1c9004ff8f00488234924bf913fead6c72cc9884 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -66,8 +66,7 @@ class AnalysisServer {
AnalysisServer(this.channel) {
AnalysisEngine.instance.logger = new AnalysisLogger();
running = true;
- // TODO set running=false on done or error
- channel.listen(handleRequest);
+ channel.listen(handleRequest, onDone: done, onError: error);
}
/**
@@ -92,7 +91,7 @@ class AnalysisServer {
* There was an error related to the socket from which requests are being
* read.
*/
- void error() {
+ void error(argument) {
running = false;
}
@@ -102,9 +101,14 @@ class AnalysisServer {
void handleRequest(Request request) {
int count = handlers.length;
for (int i = 0; i < count; i++) {
- Response response = handlers[i].handleRequest(request);
- if (response != null) {
- channel.sendResponse(response);
+ try {
+ Response response = handlers[i].handleRequest(request);
+ if (response != null) {
+ channel.sendResponse(response);
+ return;
+ }
+ } on RequestFailure catch (exception) {
+ channel.sendResponse(exception.response);
return;
}
}
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_logger.dart ('k') | pkg/analysis_server/lib/src/channel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698