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

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

Issue 24246002: Lazily throw pubspec parsing exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 3 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 | « sdk/lib/_internal/pub/lib/src/command.dart ('k') | sdk/lib/_internal/pub/lib/src/pubspec.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/package.dart
diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart
index 63ed342342888dd28b7d5dc6496da1afc4bf0892..ec9d6a57fa73b36ef1a70bc0db9fa59f8f6112f2 100644
--- a/sdk/lib/_internal/pub/lib/src/package.dart
+++ b/sdk/lib/_internal/pub/lib/src/package.dart
@@ -62,7 +62,7 @@ class Package {
/// `null` if the package being loaded is the entrypoint package.
Package.load(String name, String packageDir, SourceRegistry sources)
: dir = packageDir,
- pubspec = new Pubspec.load(name, packageDir, sources);
+ pubspec = new Pubspec.load(packageDir, sources, expectedName: name);
/// Constructs a package with the given pubspec. The package will have no
/// directory associated with it.
@@ -190,31 +190,3 @@ class PackageDep extends _PackageName {
other.constraint == constraint;
}
}
-
-class PubspecNotFoundException extends ApplicationException {
- final String name;
-
- PubspecNotFoundException(String name)
- : name = name,
- super('Package "$name" doesn\'t have a pubspec.yaml file.');
-}
-
-class PubspecHasNoNameException extends ApplicationException {
- final String name;
-
- PubspecHasNoNameException(String name)
- : name = name,
- super('Package "$name"\'s pubspec.yaml file is missing the '
- 'required "name" field (e.g. "name: $name").');
-}
-
-class PubspecNameMismatchException extends ApplicationException {
- final String expectedName;
- final String actualName;
-
- PubspecNameMismatchException(String expectedName, String actualName)
- : expectedName = expectedName,
- actualName = actualName,
- super('The name you specified for your dependency, "$expectedName", '
- 'doesn\'t match the name "$actualName" in its pubspec.');
-}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command.dart ('k') | sdk/lib/_internal/pub/lib/src/pubspec.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698