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

Unified Diff: common/auth/internal/service.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: copyright 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/service.go
diff --git a/common/auth/internal/service.go b/common/auth/internal/service.go
index 7b1724dd85328f6bd74d88f86ad81154b17084cc..a31858b177c8a02bdc0bd3e5f3e8513e5078ecf3 100644
--- a/common/auth/internal/service.go
+++ b/common/auth/internal/service.go
@@ -15,8 +15,8 @@ import (
"golang.org/x/oauth2/google"
"golang.org/x/oauth2/jwt"
- "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/common/retry"
)
type serviceAccountTokenProvider struct {
@@ -87,7 +87,7 @@ func (p *serviceAccountTokenProvider) MintToken(ctx context.Context, base *oauth
switch newTok, err := grabToken(cfg.TokenSource(ctx)); {
case err == nil:
return newTok, nil
- case errors.IsTransient(err):
+ case retry.Tag.In(err):
logging.Warningf(ctx, "Error when creating access token - %s", err)
return nil, err
default:

Powered by Google App Engine
This is Rietveld 408576698