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

Unified Diff: pkg/barback/lib/src/graph/asset_cascade.dart

Issue 298133006: Handle synchronous asset load errors in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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/CHANGELOG.md ('k') | pkg/barback/test/package_graph/errors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/graph/asset_cascade.dart
diff --git a/pkg/barback/lib/src/graph/asset_cascade.dart b/pkg/barback/lib/src/graph/asset_cascade.dart
index ca087857311d0197562301fec645e468ecba74a7..80d448ca772b7cd0378e2bd649512e4ad326914d 100644
--- a/pkg/barback/lib/src/graph/asset_cascade.dart
+++ b/pkg/barback/lib/src/graph/asset_cascade.dart
@@ -13,6 +13,7 @@ import '../asset/asset_set.dart';
import '../errors.dart';
import '../log.dart';
import '../transformer/transformer.dart';
+import '../utils.dart';
import '../utils/cancelable_future.dart';
import 'node_status.dart';
import 'node_streams.dart';
@@ -138,8 +139,8 @@ class AssetCascade {
// return out-of-date contents for the asset.
if (_loadingSources.containsKey(id)) _loadingSources[id].cancel();
- _loadingSources[id] =
- new CancelableFuture<Asset>(graph.provider.getAsset(id));
+ _loadingSources[id] = new CancelableFuture<Asset>(
+ syncFuture(() => graph.provider.getAsset(id)));
_loadingSources[id].whenComplete(() {
_loadingSources.remove(id);
}).then((asset) {
« no previous file with comments | « pkg/barback/CHANGELOG.md ('k') | pkg/barback/test/package_graph/errors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698