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

Unified Diff: logdog/common/storage/bigtable/initialize.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/common/storage/bigtable/initialize.go
diff --git a/logdog/common/storage/bigtable/initialize.go b/logdog/common/storage/bigtable/initialize.go
index 9555c96ccb5351fc33627fecbdf764fcd05b5d6e..f58d9217b17ee925f9de6272d8aa30175bb6cad4 100644
--- a/logdog/common/storage/bigtable/initialize.go
+++ b/logdog/common/storage/bigtable/initialize.go
@@ -13,6 +13,7 @@ import (
"github.com/luci/luci-go/common/errors"
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/retry"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/logdog/common/storage"
"golang.org/x/net/context"
)
@@ -41,13 +42,13 @@ func tableExists(ctx context.Context, c *bigtable.AdminClient, name string) (boo
}
func waitForTable(ctx context.Context, c *bigtable.AdminClient, name string) error {
- return retry.Retry(ctx, retry.TransientOnly(retry.Default), func() error {
+ return retry.Retry(ctx, transient.Only(retry.Default), func() error {
exists, err := tableExists(ctx, c, name)
if err != nil {
return err
}
if !exists {
- return errors.WrapTransient(errors.New("table does not exist"))
+ return errors.New("table does not exist", transient.Tag)
}
return nil
}, func(err error, delay time.Duration) {

Powered by Google App Engine
This is Rietveld 408576698