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

Unified Diff: appengine/gaeauth/server/internal/authdbimpl/handlers.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: appengine/gaeauth/server/internal/authdbimpl/handlers.go
diff --git a/appengine/gaeauth/server/internal/authdbimpl/handlers.go b/appengine/gaeauth/server/internal/authdbimpl/handlers.go
index 404819f08c48b3836fdae6b0f053943fdfa38aa0..7a82dc5fc933ce4cd820d5fd1658ea3090608a54 100644
--- a/appengine/gaeauth/server/internal/authdbimpl/handlers.go
+++ b/appengine/gaeauth/server/internal/authdbimpl/handlers.go
@@ -17,6 +17,7 @@ import (
"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/service"
"github.com/luci/luci-go/server/router"
)
@@ -149,7 +150,7 @@ func processPubSubRequest(c context.Context, rw http.ResponseWriter, r *http.Req
// replyError sends HTTP 500 on transient errors, HTTP 400 on fatal ones.
func replyError(c context.Context, rw http.ResponseWriter, err error) {
logging.Errorf(c, "Error while processing PubSub notification - %s", err)
- if errors.IsTransient(err) {
+ if transient.Tag.In(err) {
http.Error(rw, err.Error(), http.StatusInternalServerError)
} else {
http.Error(rw, err.Error(), http.StatusBadRequest)

Powered by Google App Engine
This is Rietveld 408576698