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

Unified Diff: utils/pub/pub.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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 | « utils/pub/oauth2.dart ('k') | utils/pub/safe_http_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/pub.dart
diff --git a/utils/pub/pub.dart b/utils/pub/pub.dart
index 811c198de0e2b2537d740318313a28ba5a21d425..e523608253cec6ecbdee0a8c21ffca4ac299955c 100644
--- a/utils/pub/pub.dart
+++ b/utils/pub/pub.dart
@@ -236,7 +236,9 @@ abstract class PubCommand {
exit(exit_codes.USAGE);
}
- handleError(error, trace) {
+ handleError(error) {
+ var trace = getAttachedStackTrace(error);
+
// This is basically the top-level exception handler so that we don't
// spew a stack trace on our users.
var message;
@@ -277,8 +279,7 @@ abstract class PubCommand {
if (commandFuture == null) return true;
return commandFuture;
- }).whenComplete(() => cache_.deleteTempDir()).catchError((asyncError) {
- var e = asyncError.error;
+ }).whenComplete(() => cache_.deleteTempDir()).catchError((e) {
if (e is PubspecNotFoundException && e.name == null) {
e = 'Could not find a file named "pubspec.yaml" in the directory '
'${path.current}.';
@@ -287,7 +288,7 @@ abstract class PubCommand {
'${path.basename(path.current)}").';
}
- handleError(e, asyncError.stackTrace);
+ handleError(e);
}).then((_) {
// Explicitly exit on success to ensure that any dangling dart:io handles
// don't cause the process to never terminate.
« no previous file with comments | « utils/pub/oauth2.dart ('k') | utils/pub/safe_http_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698