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

Unified Diff: google_apis/gaia/oauth2_access_token_fetcher.cc

Issue 12630010: Files.app: Treats HTTP_FORBIDDEN (403) as temporary error on authentication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test failure Created 7 years, 9 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 | « chrome/browser/google_apis/auth_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/oauth2_access_token_fetcher.cc
diff --git a/google_apis/gaia/oauth2_access_token_fetcher.cc b/google_apis/gaia/oauth2_access_token_fetcher.cc
index edefa7e33bde8b26e7ddd97e6280bcd6b6667ef4..731dab8127817326918512cc5438df4319bfe24c 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher.cc
@@ -129,6 +129,15 @@ void OAuth2AccessTokenFetcher::EndGetAccessToken(
return;
}
+ // HTTP_FORBIDDEN (403) is treated as temporary error, because it may be
+ // '403 Rate Limit Exeeded.'
+ if (source->GetResponseCode() == net::HTTP_FORBIDDEN) {
+ OnGetTokenFailure(GoogleServiceAuthError(
+ GoogleServiceAuthError::SERVICE_UNAVAILABLE));
+ return;
+ }
+
+ // The other errors are treated as permanent error.
if (source->GetResponseCode() != net::HTTP_OK) {
OnGetTokenFailure(GoogleServiceAuthError(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
« no previous file with comments | « chrome/browser/google_apis/auth_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698