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

Unified Diff: appengine/gaeauth/server/oauth.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: appengine/gaeauth/server/oauth.go
diff --git a/appengine/gaeauth/server/oauth.go b/appengine/gaeauth/server/oauth.go
index ea2af1b2ec62647e0e1d6b330c0762d2d95cf656..58c4697ea6b6702456cc1323f6e69fa753c7d13d 100644
--- a/appengine/gaeauth/server/oauth.go
+++ b/appengine/gaeauth/server/oauth.go
@@ -20,6 +20,7 @@ import (
"github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/gcloud/googleoauth"
"github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/server/auth"
"github.com/luci/luci-go/server/auth/identity"
)
@@ -78,7 +79,7 @@ func (m *OAuth2Method) authenticateProd(c context.Context, scopes []string) (*au
ClientID: u.ClientID,
}, nil
}
- return nil, errors.WrapTransient(err)
+ return nil, transient.Tag.Apply(err)
}
type tokenCheckCache string
@@ -109,7 +110,8 @@ func (m *OAuth2Method) authenticateDevServer(c context.Context, header string, s
if err == googleoauth.ErrBadToken {
return nil, err
}
- return nil, errors.WrapTransient(fmt.Errorf("oauth: transient error when validating token - %s", err))
+ return nil, errors.Annotate(err).Reason("oauth: transient error when validating token").
+ Tag(transient.Tag).Err()
}
// Verify the token contains a validated email.

Powered by Google App Engine
This is Rietveld 408576698