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

Unified Diff: server/auth/xsrf/xsrf.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/xsrf/xsrf.go
diff --git a/server/auth/xsrf/xsrf.go b/server/auth/xsrf/xsrf.go
index c5fd847f57ab7d496591a025f7d0135da228404d..f5d3d45cc298c960a3f38992122f891f4b854ba4 100644
--- a/server/auth/xsrf/xsrf.go
+++ b/server/auth/xsrf/xsrf.go
@@ -18,8 +18,8 @@ import (
"golang.org/x/net/context"
- "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/server/auth"
"github.com/luci/luci-go/server/router"
@@ -76,7 +76,7 @@ func WithTokenCheck(c *router.Context, next router.Handler) {
return
}
switch err := Check(c.Context, tok); {
- case errors.IsTransient(err):
+ case transient.Tag.In(err):
replyError(c.Context, c.Writer, http.StatusInternalServerError, "Transient error when checking XSRF token - %s", err)
case err != nil:
replyError(c.Context, c.Writer, http.StatusForbidden, "Bad XSRF token - %s", err)

Powered by Google App Engine
This is Rietveld 408576698