Chromium Code Reviews| 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.errors; | 5 library barback.errors; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:stack_trace/stack_trace.dart'; | 10 import 'package:stack_trace/stack_trace.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 } | 22 } |
| 23 | 23 |
| 24 /// The interface for exceptions from the barback graph or its transformers. | 24 /// The interface for exceptions from the barback graph or its transformers. |
| 25 /// | 25 /// |
| 26 /// These exceptions are never produced by programming errors in barback. | 26 /// These exceptions are never produced by programming errors in barback. |
| 27 abstract class BarbackException implements Exception {} | 27 abstract class BarbackException implements Exception {} |
| 28 | 28 |
| 29 /// Error thrown when two or more transformers both output an asset with [id]. | 29 /// Error thrown when two or more transformers both output an asset with [id]. |
| 30 class AssetCollisionException implements BarbackException { | 30 class AssetCollisionException implements BarbackException { |
| 31 /// All the transforms that output an asset with [id]. | 31 /// All the transforms that output an asset with [id]. |
| 32 /// | |
| 33 /// This could only contain a single transform, which indicates that a | |
|
Bob Nystrom
2013/08/14 22:43:01
This took me a few reads to grok. How about "If th
nweiz
2013/08/15 21:07:02
Done.
| |
| 34 /// transformer produced an output that collides with a source asset or an | |
| 35 /// asset from a previous phase. | |
| 32 final Set<TransformInfo> transforms; | 36 final Set<TransformInfo> transforms; |
| 33 final AssetId id; | 37 final AssetId id; |
| 34 | 38 |
| 35 AssetCollisionException(Iterable<TransformInfo> transforms, this.id) | 39 AssetCollisionException(Iterable<TransformInfo> transforms, this.id) |
| 36 : transforms = new Set.from(transforms); | 40 : transforms = new Set.from(transforms); |
| 37 | 41 |
| 38 String toString() => "Transforms $transforms all emitted asset $id."; | 42 String toString() => "Transforms $transforms all emitted asset $id."; |
| 39 } | 43 } |
| 40 | 44 |
| 41 /// Error thrown when a transformer requests an input [id] which cannot be | 45 /// Error thrown when a transformer requests an input [id] which cannot be |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 | 114 |
| 111 bool operator==(other) => | 115 bool operator==(other) => |
| 112 other is TransformInfo && | 116 other is TransformInfo && |
| 113 other.transformer == transformer && | 117 other.transformer == transformer && |
| 114 other.primaryId == primaryId; | 118 other.primaryId == primaryId; |
| 115 | 119 |
| 116 int get hashCode => transformer.hashCode ^ primaryId.hashCode; | 120 int get hashCode => transformer.hashCode ^ primaryId.hashCode; |
| 117 | 121 |
| 118 String toString() => "$transformer on $primaryId"; | 122 String toString() => "$transformer on $primaryId"; |
| 119 } | 123 } |
| OLD | NEW |