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

Unified Diff: common/auth/internal/user.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/internal/user.go
diff --git a/common/auth/internal/user.go b/common/auth/internal/user.go
index 792f0d4976bf4d15ae2167f6dcebc8758637dff8..2c3512974281390e5c14d3c0ce130d412ae63b4d 100644
--- a/common/auth/internal/user.go
+++ b/common/auth/internal/user.go
@@ -11,8 +11,8 @@ import (
"golang.org/x/net/context"
"golang.org/x/oauth2"
- "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/common/retry/transient"
)
type userAuthTokenProvider struct {
@@ -88,7 +88,7 @@ func (p *userAuthTokenProvider) RefreshToken(ctx context.Context, prev, base *oa
switch newTok, err := grabToken(p.config.TokenSource(ctx, &t)); {
case err == nil:
return newTok, nil
- case errors.IsTransient(err):
+ case transient.Tag.In(err):
logging.Warningf(ctx, "Transient error when refreshing the token - %s", err)
return nil, err
default:

Powered by Google App Engine
This is Rietveld 408576698