0.5.0+2
diff --git a/lib/dartdoc.dart b/lib/dartdoc.dart
index d4e2995..3ce30d8 100644
--- a/lib/dartdoc.dart
+++ b/lib/dartdoc.dart
@@ -36,7 +36,7 @@
const String name = 'dartdoc';
// Update when pubspec version changes.
-const String version = '0.5.0+1';
+const String version = '0.5.0+2';
final String defaultOutDir = 'doc${Platform.pathSeparator}api';
diff --git a/lib/resource_loader.dart b/lib/resource_loader.dart
index 3817576..f02a343 100644
--- a/lib/resource_loader.dart
+++ b/lib/resource_loader.dart
@@ -27,14 +27,12 @@
throw new ArgumentError('path must begin with package:');
}
- try {
- return new Resource(path).readAsString().catchError((_) {
- // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
- return _doLoad(path).then((bytes) => new String.fromCharCodes(bytes));
+ // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
+ return _doLoad(path)
+ .then((bytes) => new String.fromCharCodes(bytes))
+ .catchError((_) {
+ return new Resource(path).readAsString();
});
- } catch (_) {
- return _doLoad(path).then((bytes) => new String.fromCharCodes(bytes));
- }
}
/// Loads a `package:` resource as an [List<int>].
@@ -43,12 +41,8 @@
throw new ArgumentError('path must begin with package:');
}
- try {
- // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
- return new Resource(path).readAsBytes().catchError((_) => _doLoad(path));
- } catch (_) {
- return _doLoad(path);
- }
+ // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
+ return _doLoad(path).catchError((_) => new Resource(path).readAsBytes());
}
/// Determine how to do the load. HTTP? Snapshotted? From source?
diff --git a/pubspec.yaml b/pubspec.yaml
index 929756d..bf019a2 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: dartdoc
# Also update the `version` field in lib/dartdoc.dart.
-version: 0.5.0+1
+version: 0.5.0+2
author: Dart Team <misc@dartlang.org>
description: A documentation generator for Dart.
homepage: https://github.com/dart-lang/dartdoc