| Index: utils/pub/oauth2.dart
|
| diff --git a/utils/pub/oauth2.dart b/utils/pub/oauth2.dart
|
| index 44ac07f59de34fd298003be23ae3f08b32c33613..24d798afd60d75223937e6394a2d2d4e7dbee613 100644
|
| --- a/utils/pub/oauth2.dart
|
| +++ b/utils/pub/oauth2.dart
|
| @@ -75,14 +75,15 @@ Future withClient(SystemCache cache, Future fn(Client client)) {
|
| return _saveCredentials(cache, client.credentials);
|
| });
|
| }).catchError((asyncError) {
|
| - var e = getRealError(asyncError);
|
| - if (e is ExpirationException) {
|
| + if (asyncError.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 (e is AuthorizationException) {
|
| + } else if (asyncError.error is AuthorizationException) {
|
| var message = "OAuth2 authorization failed";
|
| - if (e.description != null) message = "$message (${e.description})";
|
| + if (asyncError.error.description != null) {
|
| + message = "$message (${asyncError.error.description})";
|
| + }
|
| log.error("$message.");
|
| return clearCredentials(cache).then((_) => withClient(cache, fn));
|
| } else {
|
|
|