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

Unified Diff: server/auth/actor.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: server/auth/actor.go
diff --git a/server/auth/actor.go b/server/auth/actor.go
index 7af25b11ebc5952b10497d838cc512aedb60b649..9cbb6c942d1b5c9a083bdc1b5af48d6bc38a2902 100644
--- a/server/auth/actor.go
+++ b/server/auth/actor.go
@@ -17,10 +17,10 @@ import (
"google.golang.org/api/googleapi"
"github.com/luci/luci-go/common/clock"
- "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/gcloud/googleoauth"
"github.com/luci/luci-go/common/gcloud/iam"
"github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/common/retry/transient"
)
// MintAccessTokenParams is passed to MintAccessTokenForServiceAccount.
@@ -161,9 +161,8 @@ func MintAccessTokenForServiceAccount(ctx context.Context, params MintAccessToke
if err != nil {
if apiErr, ok := err.(*googleapi.Error); ok && apiErr.Code < 500 {
return nil, err, fmt.Sprintf("ERROR_MINTING_HTTP_%d", apiErr.Code)
- } else {
- return nil, errors.WrapTransient(err), "ERROR_TRANSIENT_IN_MINTING"
}
+ return nil, transient.Tag.Apply(err), "ERROR_TRANSIENT_IN_MINTING"
}
// Log details about the new token.

Powered by Google App Engine
This is Rietveld 408576698