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

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

Issue 183813006: Use zones to capture unexpected errors in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/barback/lib/src/package_graph.dart ('k') | no next file » | 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.phase_input; 5 library barback.phase_input;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'asset.dart'; 10 import 'asset.dart';
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 if (error is! AssetNotFoundException || error.id != input.id) { 186 if (error is! AssetNotFoundException || error.id != input.id) {
187 throw error; 187 throw error;
188 } 188 }
189 189
190 // If the asset is removed, [_tryUntilStable] will throw an 190 // If the asset is removed, [_tryUntilStable] will throw an
191 // [AssetNotFoundException]. In that case, just remove it. 191 // [AssetNotFoundException]. In that case, just remove it.
192 remove(); 192 remove();
193 }).whenComplete(() { 193 }).whenComplete(() {
194 _adjustTransformersFuture = null; 194 _adjustTransformersFuture = null;
195 }); 195 });
196
197 // Don't top-level errors coming from the input processing. Any errors will
198 // eventually be piped through [process]'s returned Future.
199 _adjustTransformersFuture.catchError((_) {});
200 } 196 }
201 197
202 // Remove any old transforms that used to have [asset] as a primary asset but 198 // Remove any old transforms that used to have [asset] as a primary asset but
203 // no longer apply to its new contents. 199 // no longer apply to its new contents.
204 Future _removeStaleTransforms(Asset asset, Set<Transformer> transformers) { 200 Future _removeStaleTransforms(Asset asset, Set<Transformer> transformers) {
205 return Future.wait(_transforms.map((transform) { 201 return Future.wait(_transforms.map((transform) {
206 return newFuture(() { 202 return newFuture(() {
207 if (!transformers.contains(transform.transformer)) return false; 203 if (!transformers.contains(transform.transformer)) return false;
208 204
209 // TODO(rnystrom): Catch all errors from isPrimary() and redirect to 205 // TODO(rnystrom): Catch all errors from isPrimary() and redirect to
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 317 }
322 318
323 return Future.wait(_transforms.map((transform) { 319 return Future.wait(_transforms.map((transform) {
324 if (!transform.isDirty) return new Future.value(new Set()); 320 if (!transform.isDirty) return new Future.value(new Set());
325 return transform.apply(); 321 return transform.apply();
326 })).then((outputs) => unionAll(outputs)); 322 })).then((outputs) => unionAll(outputs));
327 } 323 }
328 324
329 String toString() => "phase input in $_location for $input"; 325 String toString() => "phase input in $_location for $input";
330 } 326 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/package_graph.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698