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

Unified Diff: scheduler/appengine/engine/pubsub.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/engine/pubsub.go
diff --git a/scheduler/appengine/engine/pubsub.go b/scheduler/appengine/engine/pubsub.go
index 4051135cc5ac7023067724c386dabe851ed481e6..2704790350340b634f7d6186221fb9f862b8fd13 100644
--- a/scheduler/appengine/engine/pubsub.go
+++ b/scheduler/appengine/engine/pubsub.go
@@ -16,6 +16,7 @@ import (
"github.com/luci/luci-go/common/data/stringset"
"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"
)
@@ -60,7 +61,7 @@ func configureTopic(c context.Context, topic, sub, pushURL, publisher, pubSubURL
_, err = service.Projects.Topics.Create(topic, &pubsub.Topic{}).Context(c).Do()
if err != nil && !isHTTP409(err) {
logging.Errorf(c, "Failed - %s", err)
- return errors.WrapTransient(err)
+ return transient.Tag.Apply(err)
}
// Create the subscription to this topic. Ignore HTTP 409.
@@ -74,7 +75,7 @@ func configureTopic(c context.Context, topic, sub, pushURL, publisher, pubSubURL
}).Context(c).Do()
if err != nil && !isHTTP409(err) {
logging.Errorf(c, "Failed - %s", err)
- return errors.WrapTransient(err)
+ return transient.Tag.Apply(err)
}
// Modify topic's IAM policy to allow publisher to publish.
@@ -98,7 +99,7 @@ func configureTopic(c context.Context, topic, sub, pushURL, publisher, pubSubURL
}
logging.Errorf(c, "Failed - %s", err)
}
- return errors.WrapTransient(err)
+ return transient.Tag.Apply(err)
}
// pullSubcription pulls one message from PubSub subscription.

Powered by Google App Engine
This is Rietveld 408576698