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

Unified Diff: utils/pub/oauth2.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/log.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/oauth2.dart
diff --git a/utils/pub/oauth2.dart b/utils/pub/oauth2.dart
index 85bfed719328f178cef6ccd3d44aef196c43c0a2..4a436811a6e919baba36286a0bb75b5b8ef7c979 100644
--- a/utils/pub/oauth2.dart
+++ b/utils/pub/oauth2.dart
@@ -82,21 +82,21 @@ Future withClient(SystemCache cache, Future fn(Client client)) {
// Be sure to save the credentials even when an error happens.
_saveCredentials(cache, client.credentials);
});
- }).catchError((asyncError) {
- if (asyncError.error is ExpirationException) {
+ }).catchError((error) {
+ if (error is ExpirationException) {
log.error("Pub's authorization to upload packages has expired and "
"can't be automatically refreshed.");
return withClient(cache, fn);
- } else if (asyncError.error is AuthorizationException) {
+ } else if (error is AuthorizationException) {
var message = "OAuth2 authorization failed";
- if (asyncError.error.description != null) {
- message = "$message (${asyncError.error.description})";
+ if (error.description != null) {
+ message = "$message (${error.description})";
}
log.error("$message.");
clearCredentials(cache);
return withClient(cache, fn);
} else {
- throw asyncError;
+ throw error;
}
});
}
« no previous file with comments | « utils/pub/log.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698