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

Unified Diff: lib/src/asset/dart/serialize/get_input_transform.dart

Issue 2256623003: Fix more strong mode errors and warnings. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 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 | « no previous file | lib/src/barback/transformer_id.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/asset/dart/serialize/get_input_transform.dart
diff --git a/lib/src/asset/dart/serialize/get_input_transform.dart b/lib/src/asset/dart/serialize/get_input_transform.dart
index 328d72d225f8df2784a622c1d9e061da81c07bdd..b0c775156c3e2d1eff791feb0ca5778c215d3156 100644
--- a/lib/src/asset/dart/serialize/get_input_transform.dart
+++ b/lib/src/asset/dart/serialize/get_input_transform.dart
@@ -22,10 +22,13 @@ abstract class GetInputTransform {
Stream<List<int>> readInput(AssetId id) =>
StreamCompleter.fromFuture(getInput(id).then((input) => input.read()));
- Future<bool> hasInput(AssetId id) {
- return getInput(id).then((_) => true).catchError((error) {
- if (error is AssetNotFoundException && error.id == id) return false;
- throw error;
- });
+ Future<bool> hasInput(AssetId id) async {
+ try {
+ await getInput(id);
+ return true;
+ } on AssetNotFoundException catch (error) {
+ if (error.id == id) return false;
+ rethrow;
+ }
}
}
« no previous file with comments | « no previous file | lib/src/barback/transformer_id.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698