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

Unified Diff: tokenserver/appengine/impl/utils/tokensigning/signer.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: tokenserver/appengine/impl/utils/tokensigning/signer.go
diff --git a/tokenserver/appengine/impl/utils/tokensigning/signer.go b/tokenserver/appengine/impl/utils/tokensigning/signer.go
index f71904bbc17cb2750e1558cd9ea1fa966726697c..76db83d471708076d451493255f0df956e4c3885 100644
--- a/tokenserver/appengine/impl/utils/tokensigning/signer.go
+++ b/tokenserver/appengine/impl/utils/tokensigning/signer.go
@@ -10,7 +10,7 @@ import (
"github.com/golang/protobuf/proto"
"golang.org/x/net/context"
- "github.com/luci/luci-go/common/errors"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/server/auth/signing"
)
@@ -53,7 +53,7 @@ type Signer struct {
func (s *Signer) SignToken(c context.Context, body proto.Message) (string, error) {
info, err := s.Signer.ServiceInfo(c)
if err != nil {
- return "", errors.WrapTransient(err)
+ return "", transient.Tag.Apply(err)
}
blob, err := proto.Marshal(body)
if err != nil {
@@ -62,7 +62,7 @@ func (s *Signer) SignToken(c context.Context, body proto.Message) (string, error
withCtx := prependSigningContext(blob, s.SigningContext)
keyID, sig, err := s.Signer.SignBytes(c, withCtx)
if err != nil {
- return "", errors.WrapTransient(err)
+ return "", transient.Tag.Apply(err)
}
tok, err := proto.Marshal(s.Wrap(&Unwrapped{
Body: blob,

Powered by Google App Engine
This is Rietveld 408576698