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

Unified Diff: server/auth/openid/method.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/openid/method.go
diff --git a/server/auth/openid/method.go b/server/auth/openid/method.go
index c05d50f338707bc75547c65baaccb22016ecf631..401a687f97ef9d5da77e8e9b24d1d7e9d962bb01 100644
--- a/server/auth/openid/method.go
+++ b/server/auth/openid/method.go
@@ -17,6 +17,7 @@ import (
"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/transient"
"github.com/luci/luci-go/server/auth"
"github.com/luci/luci-go/server/router"
)
@@ -364,7 +365,7 @@ func removeCookie(rw http.ResponseWriter, r *http.Request, cookie string) {
// HTTP 400 on fatal errors (that can happen only on bad requests).
func replyError(c context.Context, rw http.ResponseWriter, err error, msg string, args ...interface{}) {
code := http.StatusBadRequest
- if errors.IsTransient(err) {
+ if transient.Tag.In(err) {
code = http.StatusInternalServerError
}
msg = fmt.Sprintf(msg, args...)

Powered by Google App Engine
This is Rietveld 408576698