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

Unified Diff: scheduler/appengine/frontend/handler.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: scheduler/appengine/frontend/handler.go
diff --git a/scheduler/appengine/frontend/handler.go b/scheduler/appengine/frontend/handler.go
index c7c0da090d50df0b27443249a750d6060f6cea5d..104130d661a5721d9b4b4e421a14f3a650801a6c 100644
--- a/scheduler/appengine/frontend/handler.go
+++ b/scheduler/appengine/frontend/handler.go
@@ -35,8 +35,8 @@ import (
"github.com/luci/luci-go/appengine/gaemiddleware"
"github.com/luci/luci-go/common/data/rand/mathrand"
- "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/scheduler/api/scheduler/v1"
@@ -85,7 +85,7 @@ func (c *requestContext) fail(code int, msg string, args ...interface{}) {
// retrying the task.
func (c *requestContext) err(e error, msg string, args ...interface{}) {
code := 500
- if !errors.IsTransient(e) {
+ if !transient.Tag.In(e) {
code = 202
}
args = append(args, e)
@@ -253,7 +253,7 @@ func readConfigCron(c *router.Context) {
})
}
if err = tq.Add(rc.Context, "read-project-config", tasks...); err != nil {
- rc.err(errors.WrapTransient(err), "Failed to add tasks to task queue")
+ rc.err(transient.Tag.Apply(err), "Failed to add tasks to task queue")
} else {
rc.ok()
}

Powered by Google App Engine
This is Rietveld 408576698