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

Unified Diff: utils/pub/package.dart

Issue 11235067: Apply patch from other client. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | utils/pub/pubspec.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/package.dart
diff --git a/utils/pub/package.dart b/utils/pub/package.dart
index 00eaf842fef7f15947f318d5520dabd073b84c41..8d84546ec8f676209b7164ce815c5293b948ff88 100644
--- a/utils/pub/package.dart
+++ b/utils/pub/package.dart
@@ -27,12 +27,17 @@ class Package {
if (!exists) throw new PubspecNotFoundException(name);
return readTextFile(pubspecPath);
}).transform((contents) {
- var pubspec = new Pubspec.parse(contents, sources);
- if (pubspec.name == null) throw new PubspecHasNoNameException(name);
- if (name != null && pubspec.name != name) {
- throw new PubspecNameMismatchException(name, pubspec.name);
+ try {
+ var pubspec = new Pubspec.parse(contents, sources);
+
+ if (pubspec.name == null) throw new PubspecHasNoNameException(name);
+ if (name != null && pubspec.name != name) {
+ throw new PubspecNameMismatchException(name, pubspec.name);
+ }
+ return new Package._(packageDir, pubspec);
+ } on FormatException catch (ex) {
+ throw 'Could not parse $pubspecPath:\n${ex.message}';
}
- return new Package._(packageDir, pubspec);
});
}
« no previous file with comments | « no previous file | utils/pub/pubspec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698