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

Unified Diff: common/auth/auth.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: more refactor Created 3 years, 6 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: common/auth/auth.go
diff --git a/common/auth/auth.go b/common/auth/auth.go
index 5a2bc8740188b55eefaaeb08c9bb3f50e2380ffc..382ad63c228396ca721e2a952cd35a27bf1cd931 100644
--- a/common/auth/auth.go
+++ b/common/auth/auth.go
@@ -41,6 +41,7 @@ import (
"github.com/luci/luci-go/common/gcloud/iam"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/retry"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/lucictx"
)
@@ -1195,7 +1196,7 @@ func retryParams() retry.Iterator {
// mintTokenWithRetries calls provider's MintToken() retrying on transient
// errors a bunch of times. Called only for non-interactive providers.
func (t *tokenWithProvider) mintTokenWithRetries(ctx context.Context, base *oauth2.Token) (tok *oauth2.Token, err error) {
- err = retry.Retry(ctx, retry.TransientOnly(retryParams), func() error {
+ err = retry.Retry(ctx, transient.Only(retryParams), func() error {
tok, err = t.provider.MintToken(ctx, base)
return err
}, nil)
@@ -1205,7 +1206,7 @@ func (t *tokenWithProvider) mintTokenWithRetries(ctx context.Context, base *oaut
// refreshTokenWithRetries calls providers' RefreshToken(...) retrying on
// transient errors a bunch of times.
func (t *tokenWithProvider) refreshTokenWithRetries(ctx context.Context, prev, base *oauth2.Token) (tok *oauth2.Token, err error) {
- err = retry.Retry(ctx, retry.TransientOnly(retryParams), func() error {
+ err = retry.Retry(ctx, transient.Only(retryParams), func() error {
tok, err = t.provider.RefreshToken(ctx, prev, base)
return err
}, nil)
« no previous file with comments | « cipd/client/cli/main.go ('k') | common/auth/auth_test.go » ('j') | common/errors/tags.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698