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

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

Issue 854443002: Catch and report exceptions in computers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
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 driver; 5 library driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:analysis_server/plugin/plugin.dart'; 10 import 'package:analysis_server/plugin/plugin.dart';
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 * exceptions and both report them to the client and send them to the given 245 * exceptions and both report them to the client and send them to the given
246 * instrumentation [service]. If a [print] function is provided, then also 246 * instrumentation [service]. If a [print] function is provided, then also
247 * capture any data printed by the callback and redirect it to the function. 247 * capture any data printed by the callback and redirect it to the function.
248 */ 248 */
249 dynamic _captureExceptions(InstrumentationService service, dynamic callback(), 249 dynamic _captureExceptions(InstrumentationService service, dynamic callback(),
250 {void print(String line)}) { 250 {void print(String line)}) {
251 Function errorFunction = 251 Function errorFunction =
252 (Zone self, ZoneDelegate parent, Zone zone, dynamic exception, 252 (Zone self, ZoneDelegate parent, Zone zone, dynamic exception,
253 StackTrace stackTrace) { 253 StackTrace stackTrace) {
254 service.logPriorityException(exception, stackTrace); 254 service.logPriorityException(exception, stackTrace);
255 socketServer.analysisServer.reportException(exception, stackTrace); 255 AnalysisServer analysisServer = socketServer.analysisServer;
256 analysisServer.sendServerErrorNotification(exception, stackTrace);
256 throw exception; 257 throw exception;
257 }; 258 };
258 Function printFunction = print == null ? 259 Function printFunction = print == null ?
259 null : 260 null :
260 (Zone self, ZoneDelegate parent, Zone zone, String line) { 261 (Zone self, ZoneDelegate parent, Zone zone, String line) {
261 // Note: we don't pass the line on to stdout, because that is reserved 262 // Note: we don't pass the line on to stdout, because that is reserved
262 // for communication to the client. 263 // for communication to the client.
263 print(line); 264 print(line);
264 }; 265 };
265 ZoneSpecification zoneSpecification = new ZoneSpecification( 266 ZoneSpecification zoneSpecification = new ZoneSpecification(
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 /** 322 /**
322 * Print information about how to use the server. 323 * Print information about how to use the server.
323 */ 324 */
324 void _printUsage(ArgParser parser) { 325 void _printUsage(ArgParser parser) {
325 print('Usage: $BINARY_NAME [flags]'); 326 print('Usage: $BINARY_NAME [flags]');
326 print(''); 327 print('');
327 print('Supported flags are:'); 328 print('Supported flags are:');
328 print(parser.usage); 329 print(parser.usage);
329 } 330 }
330 } 331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698