Index: pkg/barback/lib/src/package_graph.dart |
diff --git a/pkg/barback/lib/src/package_graph.dart b/pkg/barback/lib/src/package_graph.dart |
index ec358e64deb15d46c765ca633abf0b7b5c96c6db..137c16b405b7c0f5426627decb98cff4f635ad59 100644 |
--- a/pkg/barback/lib/src/package_graph.dart |
+++ b/pkg/barback/lib/src/package_graph.dart |
@@ -87,15 +87,10 @@ class PackageGraph { |
// either. |
if (_cascadeResults.values.any((result) => result == null)) return; |
- var errors = unionAll( |
- _cascadeResults.values.map((result) => result.errors)); |
- |
- var numLogErrors = _cascadeResults.values.fold(0, |
- (numErrors, result) => result.numErrors - result.errors.length); |
- |
// Include all build errors for all cascades. If no cascades have |
// errors, the result will automatically be considered a success. |
- _resultsController.add(new BuildResult(errors, numLogErrors)); |
+ _resultsController.add( |
+ new BuildResult.aggregate(_cascadeResults.values)); |
}, onError: (error) { |
_lastUnexpectedError = error; |
_resultsController.addError(error); |
@@ -138,10 +133,9 @@ class PackageGraph { |
} |
// If the build completed with an error, complete the future with it. |
- var errors = unionAll( |
- _cascadeResults.values.map((result) => result.errors)); |
- if (errors.isNotEmpty) { |
- return new Future.error(BarbackException.aggregate(errors)); |
+ var result = new BuildResult.aggregate(_cascadeResults.values); |
+ if (!result.succeeded) { |
+ return new Future.error(BarbackException.aggregate(result.errors)); |
} |
// Otherwise, return all of the final output assets. |