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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/barback.dart

Issue 68493003: Ensure that errors have stack traces attached. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « pkg/scheduled_test/test/utils.dart ('k') | sdk/lib/_internal/pub/lib/src/barback/server.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 pub.barback; 5 library pub.barback;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
11 import 'package:stack_trace/stack_trace.dart';
11 12
12 import 'barback/load_all_transformers.dart'; 13 import 'barback/load_all_transformers.dart';
13 import 'barback/pub_package_provider.dart'; 14 import 'barback/pub_package_provider.dart';
14 import 'barback/server.dart'; 15 import 'barback/server.dart';
15 import 'barback/sources.dart'; 16 import 'barback/sources.dart';
16 import 'log.dart' as log; 17 import 'log.dart' as log;
17 import 'package_graph.dart'; 18 import 'package_graph.dart';
18 import 'utils.dart'; 19 import 'utils.dart';
19 20
20 export 'barback/sources.dart' show WatcherType; 21 export 'barback/sources.dart' show WatcherType;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 loadSources(graph, barback); 127 loadSources(graph, barback);
127 }).then((_) { 128 }).then((_) {
128 var completer = new Completer(); 129 var completer = new Completer();
129 130
130 // If any errors get emitted either by barback or by the server, including 131 // If any errors get emitted either by barback or by the server, including
131 // non-programmatic barback errors, they should take down the whole 132 // non-programmatic barback errors, they should take down the whole
132 // program. 133 // program.
133 var subscriptions = [ 134 var subscriptions = [
134 server.barback.errors.listen((error) { 135 server.barback.errors.listen((error) {
135 if (error is TransformerException) error = error.error; 136 if (error is TransformerException) error = error.error;
136 if (!completer.isCompleted) completer.completeError(error); 137 if (!completer.isCompleted) {
138 completer.completeError(error, new Trace.current());
139 }
137 }), 140 }),
138 server.barback.results.listen((_) {}, onError: (error, stackTrace) { 141 server.barback.results.listen((_) {}, onError: (error, stackTrace) {
139 if (completer.isCompleted) return; 142 if (completer.isCompleted) return;
140 completer.completeError(error, stackTrace); 143 completer.completeError(error, stackTrace);
141 }), 144 }),
142 server.results.listen((_) {}, onError: (error, stackTrace) { 145 server.results.listen((_) {}, onError: (error, stackTrace) {
143 if (completer.isCompleted) return; 146 if (completer.isCompleted) return;
144 completer.completeError(error, stackTrace); 147 completer.completeError(error, stackTrace);
145 }) 148 })
146 ]; 149 ];
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 304
302 case LogLevel.WARNING: 305 case LogLevel.WARNING:
303 log.warning("${log.yellow(prefix)}\n$message"); 306 log.warning("${log.yellow(prefix)}\n$message");
304 break; 307 break;
305 308
306 case LogLevel.INFO: 309 case LogLevel.INFO:
307 log.message("$prefix\n$message"); 310 log.message("$prefix\n$message");
308 break; 311 break;
309 } 312 }
310 } 313 }
OLDNEW
« no previous file with comments | « pkg/scheduled_test/test/utils.dart ('k') | sdk/lib/_internal/pub/lib/src/barback/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698