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

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

Issue 24246002: Lazily throw pubspec parsing exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: sdk/lib/_internal/pub/lib/src/command.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command.dart b/sdk/lib/_internal/pub/lib/src/command.dart
index 9689cc6e9e81e70be0933e63f025bfd71ab70f01..94ab4f890fd68a41944baea8ce076736de1e6517 100644
--- a/sdk/lib/_internal/pub/lib/src/command.dart
+++ b/sdk/lib/_internal/pub/lib/src/command.dart
@@ -128,17 +128,9 @@ and include the results in a bug report on http://dartbug.com/new.
if (commandFuture == null) return true;
return commandFuture;
- }).whenComplete(() => cache.deleteTempDir()).catchError((e) {
- if (e is PubspecNotFoundException && e.name == null) {
- e = new ApplicationException('Could not find a file named '
- '"pubspec.yaml" in the directory ${path.current}.');
- } else if (e is PubspecHasNoNameException && e.name == null) {
- e = new ApplicationException('pubspec.yaml is missing the required '
- '"name" field (e.g. "name: ${path.basename(path.current)}").');
- }
-
- handleError(e);
- }).then((_) {
+ }).whenComplete(() => cache.deleteTempDir())
+ .catchError(handleError)
+ .then((_) {
// Explicitly exit on success to ensure that any dangling dart:io handles
// don't cause the process to never terminate.
exit(0);

Powered by Google App Engine
This is Rietveld 408576698