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

Side by Side Diff: pkg/barback/lib/src/build_result.dart

Issue 48483002: Remove deprecated parts of dart:async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. 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/barback/lib/src/asset_cascade.dart ('k') | pkg/barback/lib/src/errors.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 barback.build_result; 5 library barback.build_result;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:stack_trace/stack_trace.dart'; 9 import 'package:stack_trace/stack_trace.dart';
10 10
(...skipping 29 matching lines...) Expand all
40 /// [results]. 40 /// [results].
41 factory BuildResult.aggregate(Iterable<BuildResult> results) { 41 factory BuildResult.aggregate(Iterable<BuildResult> results) {
42 var errors = unionAll(results.map((result) => result.errors)); 42 var errors = unionAll(results.map((result) => result.errors));
43 return new BuildResult(errors); 43 return new BuildResult(errors);
44 } 44 }
45 45
46 String toString() { 46 String toString() {
47 if (succeeded) return "success"; 47 if (succeeded) return "success";
48 48
49 return "errors:\n" + errors.map((error) { 49 return "errors:\n" + errors.map((error) {
50 var stackTrace = getAttachedStackTrace(error); 50 var stackTrace = null;
51 if (stackTrace != null) stackTrace = new Trace.from(stackTrace); 51 if (error is TransformerException || error is AssetLoadException) {
52 stackTrace = new Trace.from(error.stackTrace);
53 }
52 54
53 var msg = new StringBuffer(); 55 var msg = new StringBuffer();
54 msg.write(prefixLines(error.toString())); 56 msg.write(prefixLines(error.toString()));
55 if (stackTrace != null) { 57 if (stackTrace != null) {
56 msg.write("\n\n"); 58 msg.write("\n\n");
57 msg.write("Stack trace:\n"); 59 msg.write("Stack trace:\n");
58 msg.write(prefixLines(stackTrace.toString())); 60 msg.write(prefixLines(stackTrace.toString()));
59 } 61 }
60 return msg.toString(); 62 return msg.toString();
61 }).join("\n\n"); 63 }).join("\n\n");
62 } 64 }
63 } 65 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/asset_cascade.dart ('k') | pkg/barback/lib/src/errors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698