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

Unified Diff: server/auth/delegation.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/delegation.go
diff --git a/server/auth/delegation.go b/server/auth/delegation.go
index 621335b2095108a919b99f42b141998345124430..f6e82083a5c406d69115117332ab967c18d3c940 100644
--- a/server/auth/delegation.go
+++ b/server/auth/delegation.go
@@ -13,9 +13,9 @@ import (
"golang.org/x/net/context"
"github.com/luci/luci-go/common/clock"
- "github.com/luci/luci-go/common/errors"
"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/grpc/grpcutil"
"github.com/luci/luci-go/grpc/prpc"
"github.com/luci/luci-go/server/auth/delegation"
@@ -25,7 +25,7 @@ import (
)
var (
- // ErrTokenServerNotConfigured is returned by MintDelegationToken if the
+ // ErrTokenServiceNotConfigured is returned by MintDelegationToken if the
// token service URL is not configured. This usually means the corresponding
// auth service is not paired with a token server.
ErrTokenServiceNotConfigured = fmt.Errorf("auth: token service URL is not configured")
@@ -235,7 +235,7 @@ func MintDelegationToken(ctx context.Context, p DelegationTokenParams) (*delegat
})
if err != nil {
err = grpcutil.WrapIfTransient(err)
- if errors.IsTransient(err) {
+ if transient.Tag.In(err) {
return nil, err, "ERROR_TRANSIENT_IN_MINTING"
}
return nil, err, "ERROR_MINTING"

Powered by Google App Engine
This is Rietveld 408576698