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

Unified Diff: luci_config/server/cfgclient/access/access.go

Issue 2963503003: [errors] Greatly simplify common/errors package. (Closed)
Patch Set: fix nits 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
« no previous file with comments | « luci_config/appengine/backend/memcache/cache.go ('k') | luci_config/server/cfgclient/backend/authority.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: luci_config/server/cfgclient/access/access.go
diff --git a/luci_config/server/cfgclient/access/access.go b/luci_config/server/cfgclient/access/access.go
index 8f26f007ee1939506ffe4dd7cfd1336ef7623e6f..4b5c597f2b7a60b00ccbb2211bba6f586f3e78a1 100644
--- a/luci_config/server/cfgclient/access/access.go
+++ b/luci_config/server/cfgclient/access/access.go
@@ -52,8 +52,8 @@ func Check(c context.Context, a backend.Authority, configSet cfgtypes.ConfigSet)
var pcfg configPB.ProjectCfg
if err := cfgclient.Get(c, cfgclient.AsService, projectConfigSet, cfgclient.ProjectConfigPath,
textproto.Message(&pcfg), nil); err != nil {
- return errors.Annotate(err).Reason("failed to load %(path)q in %(configSet)q").
- D("path", cfgclient.ProjectConfigPath).D("configSet", projectConfigSet).Err()
+ return errors.Annotate(err, "failed to load %q in %q",
+ cfgclient.ProjectConfigPath, projectConfigSet).Err()
}
id := identity.AnonymousIdentity
@@ -80,7 +80,7 @@ func Check(c context.Context, a backend.Authority, configSet cfgtypes.ConfigSet)
if len(checkGroups) > 0 {
switch canAccess, err := auth.IsMember(c, checkGroups...); {
case err != nil:
- return errors.Annotate(err).Reason("failed to check group membership").Err()
+ return errors.Annotate(err, "failed to check group membership").Err()
case canAccess:
return nil
}
« no previous file with comments | « luci_config/appengine/backend/memcache/cache.go ('k') | luci_config/server/cfgclient/backend/authority.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698