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

Unified Diff: common/auth/internal/luci_ctx.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: common/auth/internal/luci_ctx.go
diff --git a/common/auth/internal/luci_ctx.go b/common/auth/internal/luci_ctx.go
index 5816252e04d875e354a814199c9f960baac2cf9d..0e5ddd700feab4b283153cc5df8d778d15aa353f 100644
--- a/common/auth/internal/luci_ctx.go
+++ b/common/auth/internal/luci_ctx.go
@@ -20,8 +20,8 @@ import (
"golang.org/x/oauth2"
"github.com/luci/luci-go/common/auth/localauth/rpcs"
- "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/lucictx"
)
@@ -119,18 +119,18 @@ func (p *luciContextTokenProvider) MintToken(ctx context.Context, base *oauth2.T
httpResp, err := ctxhttp.Do(ctx, &http.Client{Transport: p.transport}, httpReq)
if err != nil {
- return nil, errors.WrapTransient(err)
+ return nil, transient.Tag.Apply(err)
}
defer httpResp.Body.Close()
respBody, err := ioutil.ReadAll(httpResp.Body)
if err != nil {
- return nil, errors.WrapTransient(err)
+ return nil, transient.Tag.Apply(err)
}
if httpResp.StatusCode != 200 {
err := fmt.Errorf("local auth - HTTP %d: %s", httpResp.StatusCode, strings.TrimSpace(string(respBody)))
if httpResp.StatusCode >= 500 {
- return nil, errors.WrapTransient(err)
+ return nil, transient.Tag.Apply(err)
}
return nil, err
}

Powered by Google App Engine
This is Rietveld 408576698