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

Side by Side Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 166703004: Use Future for error handling (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_logger.dart'; 9 import 'package:analysis_server/src/analysis_logger.dart';
10 import 'package:analysis_server/src/channel.dart'; 10 import 'package:analysis_server/src/channel.dart';
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } else { //if (context.analysisOptions.provideErrors) { 129 } else { //if (context.analysisOptions.provideErrors) {
130 sendNotices(notices); 130 sendNotices(notices);
131 } 131 }
132 } 132 }
133 // 133 //
134 // Schedule this method to be run again if there is any more work to be done . 134 // Schedule this method to be run again if there is any more work to be done .
135 // 135 //
136 if (contextWorkQueue.isEmpty) { 136 if (contextWorkQueue.isEmpty) {
137 running = false; 137 running = false;
138 } else { 138 } else {
139 Timer.run(() { 139 new Future(performTask).catchError((exception, stackTrace) {
devoncarew 2014/02/18 17:15:21 Does performTask() throw? I think that's the only
Brian Wilkerson 2014/02/18 17:18:38 Not if it's working as expected, but an exception
140 performTask(); 140 AnalysisEngine.instance.logger.logError3(exception);
141 }); 141 });
142 } 142 }
143 } 143 }
144 144
145 /** 145 /**
146 * Send the information in the given list of notices back to the client. 146 * Send the information in the given list of notices back to the client.
147 */ 147 */
148 void sendNotices(List<ChangeNotice> notices) { 148 void sendNotices(List<ChangeNotice> notices) {
149 for (int i = 0; i < notices.length; i++) { 149 for (int i = 0; i < notices.length; i++) {
150 ChangeNotice notice = notices[i]; 150 ChangeNotice notice = notices[i];
(...skipping 17 matching lines...) Expand all
168 } 168 }
169 } 169 }
170 170
171 /** 171 /**
172 * Send the given [notification] to the client. 172 * Send the given [notification] to the client.
173 */ 173 */
174 void sendNotification(Notification notification) { 174 void sendNotification(Notification notification) {
175 channel.sendNotification(notification); 175 channel.sendNotification(notification);
176 } 176 }
177 } 177 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698