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

Unified Diff: sdk/lib/_internal/pub/lib/src/hosted_source.dart

Issue 14476013: fix for cache list to handle old cached packages with sdk dependencies (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/hosted_source.dart
===================================================================
--- sdk/lib/_internal/pub/lib/src/hosted_source.dart (revision 21971)
+++ sdk/lib/_internal/pub/lib/src/hosted_source.dart (working copy)
@@ -128,8 +128,16 @@
_getSourceDirectory(_defaultUrl));
if (!dirExists(cacheDir)) return [];
- return listDir(path.join(cacheDir)).map((entry) =>
- new Package.load(null, entry, systemCache.sources)).toList();
+ return listDir(path.join(cacheDir)).map((entry) {
+ // TODO(keertip): instead of catching exception in pubspec parse with
+ // sdk dependency, fix to parse and report usage of sdk dependency.
+ // dartbug.com/10190
+ try {
+ return new Package.load(null, entry, systemCache.sources);
+ } on ArgumentError catch (e) {
+ log.error(e);
+ }
+ }).where((package) => package != null).toList();
}
/// When an error occurs trying to read something about [package] from [url],
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698