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

Unified Diff: logdog/client/cmd/logdog_butler/subcommand_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
Index: logdog/client/cmd/logdog_butler/subcommand_run.go
diff --git a/logdog/client/cmd/logdog_butler/subcommand_run.go b/logdog/client/cmd/logdog_butler/subcommand_run.go
index be5afa16a2f1f6590750b15a4589583d95f9b9e9..6ec39ae57a13a3bcce43a3feda8944d6f942ed99 100644
--- a/logdog/client/cmd/logdog_butler/subcommand_run.go
+++ b/logdog/client/cmd/logdog_butler/subcommand_run.go
@@ -305,19 +305,19 @@ func (cmd *runCommandRun) Run(app subcommands.Application, args []string, _ subc
// Add our pipes as direct streams, if configured.
if stdout != nil {
if err := b.AddStream(stdout, cmd.stdout.properties()); err != nil {
- return errors.Annotate(err).Reason("failed to attach STDOUT pipe stream").Err()
+ return errors.Annotate(err, "failed to attach STDOUT pipe stream").Err()
}
}
if stderr != nil {
if err := b.AddStream(stderr, cmd.stderr.properties()); err != nil {
- return errors.Annotate(err).Reason("failed to attach STDERR pipe stream").Err()
+ return errors.Annotate(err, "failed to attach STDERR pipe stream").Err()
}
}
// Execute the command. The bootstrapped application will begin executing
// in the background.
if err := proc.Start(); err != nil {
- return errors.Annotate(err).Reason("failed to start bootstrapped process").Err()
+ return errors.Annotate(err, "failed to start bootstrapped process").Err()
}
// Wait for the process' streams to finish. We must do this before Wait()
@@ -345,7 +345,7 @@ func (cmd *runCommandRun) Run(app subcommands.Application, args []string, _ subc
if err == context.Canceled {
return err
}
- return errors.Annotate(err).Reason("failed to Wait() for Butler").Err()
+ return errors.Annotate(err, "failed to Wait() for Butler").Err()
}
return nil
@@ -379,8 +379,8 @@ func (cmd *runCommandRun) maybeWriteResult(ctx context.Context, r *bootstrapResu
"path": cmd.resultPath,
}.Debugf(ctx, "Writing bootstrap result.")
if err := r.WriteJSON(cmd.resultPath); err != nil {
- return errors.Annotate(err).Reason("failed to write JSON file").
- D("path", cmd.resultPath).Err()
+ return errors.Annotate(err, "failed to write JSON file").
+ InternalReason("path(%s)", cmd.resultPath).Err()
}
return nil
}
« no previous file with comments | « logdog/client/cmd/logdog_butler/streamserver.go ('k') | logdog/client/cmd/logdog_butler/subcommand_stream.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698