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

Unified Diff: pkg/barback/lib/src/phase.dart

Issue 22961002: Add more metadata to non-programmatic barback exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Small fix Created 7 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/barback/lib/src/package_graph.dart ('k') | pkg/barback/lib/src/transform_node.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/phase.dart
diff --git a/pkg/barback/lib/src/phase.dart b/pkg/barback/lib/src/phase.dart
index 025d6525f4e43ec750703a4f683847f70ce39eb4..cf817ca3131c73516569714d8b81a195857e8ee1 100644
--- a/pkg/barback/lib/src/phase.dart
+++ b/pkg/barback/lib/src/phase.dart
@@ -69,7 +69,8 @@ class Phase {
/// being run on an old version of that asset.
var _pendingNewInputs = new Map<AssetId, AssetNode>();
- /// A map of output ids to the asset node outputs for those ids.
+ /// A map of output ids to the asset node outputs for those ids and the
+ /// transforms that produced those asset nodes.
///
/// Usually there's only one node for a given output id. However, it's
/// possible for multiple transformers in this phase to output an asset with
@@ -337,7 +338,10 @@ class Phase {
// Ensure that there's still a collision. It's possible it was resolved
// while another transform was running.
if (_outputs[collision].length <= 1) continue;
- cascade.reportError(new AssetCollisionException(collision));
+ cascade.reportError(new AssetCollisionException(
+ _outputs[collision].where((asset) => asset.transform != null)
+ .map((asset) => asset.transform.info),
+ collision));
}
});
}
@@ -361,15 +365,19 @@ class Phase {
// (chronologically) to the next phase. Pump the event queue first to give
// [_next] a chance to handle the removal of its input before getting a
// new input.
- if (wasFirst) newFuture(() => _next.addInput(assets.first));
+ if (wasFirst) {
+ newFuture(() => _next.addInput(assets.first));
+ }
// If there's still a collision, report it. This lets the user know
// if they've successfully resolved the collision or not.
if (assets.length > 1) {
// Pump the event queue to ensure that the removal of the input triggers
// a new build to which we can attach the error.
- newFuture(() =>
- cascade.reportError(new AssetCollisionException(output.id)));
+ newFuture(() => cascade.reportError(new AssetCollisionException(
+ assets.where((asset) => asset.transform != null)
+ .map((asset) => asset.transform.info),
+ output.id)));
}
});
}
« no previous file with comments | « pkg/barback/lib/src/package_graph.dart ('k') | pkg/barback/lib/src/transform_node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698