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

Unified Diff: vpython/run.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 | « vpython/python/version.go ('k') | vpython/spec/load.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vpython/run.go
diff --git a/vpython/run.go b/vpython/run.go
index 1862d859f7144b180af37f3da151c24512325ce9..42662059744526a2ac3852e9c04ea9cf5c017219 100644
--- a/vpython/run.go
+++ b/vpython/run.go
@@ -50,7 +50,7 @@ const (
func Run(c context.Context, opts Options) error {
// Resolve our Options.
if err := opts.resolve(c); err != nil {
- return errors.Annotate(err).Reason("could not resolve options").Err()
+ return errors.Annotate(err, "could not resolve options").Err()
}
// Create a local cancellation option (signal handling).
@@ -99,12 +99,12 @@ func Run(c context.Context, opts Options) error {
// Output the Python command being executed.
if err := runAndForwardSignals(c, cmd, cancelFunc); err != nil {
- return errors.Annotate(err).Reason("failed to execute bootstrapped Python").Err()
+ return errors.Annotate(err, "failed to execute bootstrapped Python").Err()
}
return nil
})
if err != nil {
- return errors.Annotate(err).Err()
+ return errors.Annotate(err, "").Err()
}
return nil
}
@@ -121,7 +121,7 @@ func runAndForwardSignals(c context.Context, cmd *exec.Cmd, cancelFunc context.C
}()
if err := cmd.Start(); err != nil {
- return errors.Annotate(err).Reason("failed to start process").Err()
+ return errors.Annotate(err, "failed to start process").Err()
}
logging.Fields{
@@ -149,7 +149,7 @@ func runAndForwardSignals(c context.Context, cmd *exec.Cmd, cancelFunc context.C
err := cmd.Wait()
logging.Debugf(c, "Python subprocess has terminated: %v", err)
if err != nil {
- return errors.Annotate(err).Err()
+ return errors.Annotate(err, "").Err()
}
return nil
}
« no previous file with comments | « vpython/python/version.go ('k') | vpython/spec/load.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698