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

Unified Diff: appengine/gaeauth/server/session.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: copyright 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/session.go
diff --git a/appengine/gaeauth/server/session.go b/appengine/gaeauth/server/session.go
index 6ddccbc01ddb056f07b2e5274abf522c22e832d3..690931d0a2b1844cb51836aedc3ee284ea7a0ce5 100644
--- a/appengine/gaeauth/server/session.go
+++ b/appengine/gaeauth/server/session.go
@@ -15,8 +15,8 @@ import (
ds "github.com/luci/gae/service/datastore"
"github.com/luci/gae/service/info"
"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/server/auth"
"github.com/luci/luci-go/server/auth/identity"
)
@@ -87,7 +87,7 @@ func (s *SessionStore) OpenSession(c context.Context, userID string, u *auth.Use
}, nil)
if err != nil {
- return "", errors.WrapTransient(err)
+ return "", retry.Tag.Apply(err)
}
return sessionID, nil
}
@@ -105,7 +105,7 @@ func (s *SessionStore) CloseSession(c context.Context, sessionID string) error {
default:
ent.IsClosed = true
ent.Closed = clock.Now(c).UTC()
- return errors.WrapTransient(ds.Put(ds.WithoutTransaction(c), ent))
+ return retry.Tag.Apply(ds.Put(ds.WithoutTransaction(c), ent))
}
}
@@ -161,7 +161,7 @@ func (s *SessionStore) fetchSession(c context.Context, sessionID string) (*sessi
case ds.ErrNoSuchEntity:
return nil, nil
default:
- return nil, errors.WrapTransient(err)
+ return nil, retry.Tag.Apply(err)
}
}

Powered by Google App Engine
This is Rietveld 408576698