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 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 Loading... | |
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 = error.stackTrace; |
nweiz
2013/10/30 22:48:18
Most BarbackErrors don't have a [stackTrace] prope
floitsch
2013/10/31 00:38:14
Done.
| |
51 if (stackTrace != null) stackTrace = new Trace.from(stackTrace); | 51 if (stackTrace != null) stackTrace = new Trace.from(stackTrace); |
52 | 52 |
53 var msg = new StringBuffer(); | 53 var msg = new StringBuffer(); |
54 msg.write(prefixLines(error.toString())); | 54 msg.write(prefixLines(error.toString())); |
55 if (stackTrace != null) { | 55 if (stackTrace != null) { |
56 msg.write("\n\n"); | 56 msg.write("\n\n"); |
57 msg.write("Stack trace:\n"); | 57 msg.write("Stack trace:\n"); |
58 msg.write(prefixLines(stackTrace.toString())); | 58 msg.write(prefixLines(stackTrace.toString())); |
59 } | 59 } |
60 return msg.toString(); | 60 return msg.toString(); |
61 }).join("\n\n"); | 61 }).join("\n\n"); |
62 } | 62 } |
63 } | 63 } |
OLD | NEW |