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

Unified Diff: buildbucket/client/cmd/buildbucket/client.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: copyright 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: buildbucket/client/cmd/buildbucket/client.go
diff --git a/buildbucket/client/cmd/buildbucket/client.go b/buildbucket/client/cmd/buildbucket/client.go
index 64ca76a963bc8224c26886c87c643a72616d06da..4f2792c7f8e181b6f6c54a5acd901c82dbbcb5f6 100644
--- a/buildbucket/client/cmd/buildbucket/client.go
+++ b/buildbucket/client/cmd/buildbucket/client.go
@@ -15,7 +15,6 @@ import (
"golang.org/x/net/context"
- "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/retry"
"golang.org/x/net/context/ctxhttp"
@@ -58,14 +57,13 @@ func (c *client) call(ctx context.Context, method, urlStr string, body interface
}
res, err := ctxhttp.Do(ctx, c.HTTP, req)
if err != nil {
- return errors.WrapTransient(err)
+ return retry.Tag.Apply(err)
}
defer res.Body.Close()
if res.StatusCode >= 500 {
bodyBytes, _ := ioutil.ReadAll(res.Body)
- return errors.WrapTransient(fmt.Errorf(
- "status %s: %s", res.Status, bodyBytes))
+ return retry.Tag.Apply(fmt.Errorf("status %s: %s", res.Status, bodyBytes))
}
response, err = ioutil.ReadAll(res.Body)

Powered by Google App Engine
This is Rietveld 408576698