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

Unified Diff: logdog/server/archivist/archivist.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: logdog/server/archivist/archivist.go
diff --git a/logdog/server/archivist/archivist.go b/logdog/server/archivist/archivist.go
index 10822b184b54d091420ebec0929f6dfa04435414..b1b3d538c4f3b7ac92c9a3f897c132a69b683ed7 100644
--- a/logdog/server/archivist/archivist.go
+++ b/logdog/server/archivist/archivist.go
@@ -19,6 +19,7 @@ import (
"github.com/luci/luci-go/common/gcloud/gs"
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/proto/google"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/common/sync/parallel"
"github.com/luci/luci-go/common/tsmon/distribution"
"github.com/luci/luci-go/common/tsmon/field"
@@ -344,7 +345,7 @@ func (a *Archivist) archiveTaskImpl(c context.Context, task Task) error {
// We will handle error creating the plan and executing the plan in the same
// switch statement below.
switch err = staged.stage(c); {
- case errors.IsTransient(err):
+ case transient.Tag.In(err):
// If this is a transient error, exit immediately and do not delete the
// archival task.
log.WithError(err).Warningf(c, "TRANSIENT error during archival operation.")
@@ -579,7 +580,7 @@ func (sa *stagedArchival) stage(c context.Context) (err error) {
var terr errors.MultiError
defer func() {
if err == nil && len(terr) > 0 {
- err = errors.WrapTransient(terr)
+ err = transient.Tag.Apply(terr)
}
}()

Powered by Google App Engine
This is Rietveld 408576698