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

Unified Diff: common/tsmon/iface.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 | « common/tsmon/config.go ('k') | deploytool/api/deploy/util.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/tsmon/iface.go
diff --git a/common/tsmon/iface.go b/common/tsmon/iface.go
index 53ae4aae82289d52caee5c26ae199e5bac098a9f..1c18c6965b2c943fa99779293ab7ceb23d06f24a 100644
--- a/common/tsmon/iface.go
+++ b/common/tsmon/iface.go
@@ -80,8 +80,7 @@ func InitializeFromFlags(c context.Context, fl *Flags) error {
// Load the config file, and override its values with flags.
config, err := loadConfig(fl.ConfigFile)
if err != nil {
- return errors.Annotate(err).Reason("failed to load config file at [%(path)s]").
- D("path", fl.ConfigFile).Err()
+ return errors.Annotate(err, "failed to load config file at [%s]", fl.ConfigFile).Err()
}
if fl.Endpoint != "" {
@@ -97,7 +96,7 @@ func InitializeFromFlags(c context.Context, fl *Flags) error {
mon, err := initMonitor(c, config)
switch {
case err != nil:
- return errors.Annotate(err).Reason("failed to initialize monitor").Err()
+ return errors.Annotate(err, "failed to initialize monitor").Err()
case mon == nil:
return nil // tsmon is disabled
}
@@ -126,7 +125,7 @@ func InitializeFromFlags(c context.Context, fl *Flags) error {
fl.Target.SetDefaultsFromHostname()
t, err := target.NewFromFlags(&fl.Target)
if err != nil {
- return errors.Annotate(err).Reason("failed to configure target from flags").Err()
+ return errors.Annotate(err, "failed to configure target from flags").Err()
}
Initialize(c, mon, store.NewInMemory(t))
« no previous file with comments | « common/tsmon/config.go ('k') | deploytool/api/deploy/util.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698