File tree 2 files changed +16
-7
lines changed 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.5.0+1
2
+ * [ bug] fixed an issue running dartdoc as a pub global activated snapshot
3
+
1
4
## 0.5.0
2
5
* [ health] remove calls to deprecated methods
3
6
* [ health] remove workaround when sorting empty iterable
Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ Future<String> loadAsString(String path) {
26
26
if (! path.startsWith ('package:' )) {
27
27
throw new ArgumentError ('path must begin with package:' );
28
28
}
29
- return new Resource (path).readAsString ().catchError ((_) async {
30
- // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
31
- var bytes = await _doLoad (path);
32
- return new String .fromCharCodes (bytes);
33
- });
29
+
30
+ try {
31
+ return new Resource (path).readAsString ().catchError ((_) {
32
+ // TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
33
+ return _doLoad (path).then ((bytes) => new String .fromCharCodes (bytes));
34
+ });
35
+ } catch (_) {
36
+ return _doLoad (path).then ((bytes) => new String .fromCharCodes (bytes));
37
+ }
34
38
}
35
39
36
40
/// Loads a `package:` resource as an [List<int>] .
@@ -39,10 +43,12 @@ Future<List<int>> loadAsBytes(String path) {
39
43
throw new ArgumentError ('path must begin with package:' );
40
44
}
41
45
42
- return new Resource (path). readAsBytes (). catchError ((_) {
46
+ try {
43
47
// TODO: Remove once https://github.com/dart-lang/pub/issues/22 is fixed.
48
+ return new Resource (path).readAsBytes ().catchError ((_) => _doLoad (path));
49
+ } catch (_) {
44
50
return _doLoad (path);
45
- });
51
+ }
46
52
}
47
53
48
54
/// Determine how to do the load. HTTP? Snapshotted? From source?
You can’t perform that action at this time.
0 commit comments