OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |