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

Unified Diff: common/system/prober/probe.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/system/filesystem/filesystem_test.go ('k') | common/tsmon/config.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/system/prober/probe.go
diff --git a/common/system/prober/probe.go b/common/system/prober/probe.go
index 3965f90c863ad9581fcccc3998ea39d0fb91cafa..f6282c95e25d32ade09f23f06b73c167692ca763 100644
--- a/common/system/prober/probe.go
+++ b/common/system/prober/probe.go
@@ -85,14 +85,12 @@ func (p *Probe) ResolveSelf(argv0 string) error {
// Get the authoritative executable from the system.
exec, err := os.Executable()
if err != nil {
- return errors.Annotate(err).Reason("failed to get executable").Err()
+ return errors.Annotate(err, "failed to get executable").Err()
}
execStat, err := os.Stat(exec)
if err != nil {
- return errors.Annotate(err).Reason("failed to stat executable: %(path)s").
- D("path", exec).
- Err()
+ return errors.Annotate(err, "failed to stat executable: %s", exec).Err()
}
// Before using "os.Executable" result, which is known to resolve symlinks on
@@ -188,9 +186,7 @@ func (p *Probe) Locate(c context.Context, cached string, env environ.Env) (strin
}
return "", errors.Reason("could not find target in system").
- D("target", p.Target).
- D("dirs", pathDirs).
- Err()
+ InternalReason("target(%s)/dirs(%v)", p.Target, pathDirs).Err()
}
// checkDir checks "checkDir" for our Target executable. It ignores
« no previous file with comments | « common/system/filesystem/filesystem_test.go ('k') | common/tsmon/config.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698