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

Unified Diff: tokenserver/appengine/impl/certchecker/certchecker.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/certchecker/certchecker.go
diff --git a/tokenserver/appengine/impl/certchecker/certchecker.go b/tokenserver/appengine/impl/certchecker/certchecker.go
index 69c6bba670cdcf8013270509a4c182da82ea869c..701848b4e6bcc5943a2ad0b441d7db6922a1eef4 100644
--- a/tokenserver/appengine/impl/certchecker/certchecker.go
+++ b/tokenserver/appengine/impl/certchecker/certchecker.go
@@ -21,7 +21,7 @@ import (
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/data/caching/lazyslot"
"github.com/luci/luci-go/common/data/caching/proccache"
- "github.com/luci/luci-go/common/errors"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/tokenserver/appengine/impl/certconfig"
)
@@ -140,7 +140,7 @@ func GetCertChecker(c context.Context, cn string) (*CertChecker, error) {
// the process lifetime.
switch exists, err := ds.Exists(c, ds.NewKey(c, "CA", cn, 0, nil)); {
case err != nil:
- return nil, 0, errors.WrapTransient(err)
+ return nil, 0, transient.Tag.Apply(err)
case !exists.All():
return nil, 0, Error{
error: fmt.Errorf("no such CA %q", cn),
@@ -283,7 +283,7 @@ func (ch *CertChecker) refetchCA(c context.Context) (*certconfig.CA, error) {
case err == ds.ErrNoSuchEntity:
return &certconfig.CA{}, nil // GetCA knows that empty struct means "no such CA"
case err != nil:
- return nil, errors.WrapTransient(err)
+ return nil, transient.Tag.Apply(err)
}
parsedConf, err := ca.ParseConfig()

Powered by Google App Engine
This is Rietveld 408576698