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

Unified Diff: logdog/client/cmd/logdog_butler/main.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 | « logdog/client/cli/subcommandQuery.go ('k') | logdog/client/cmd/logdog_butler/output_logdog.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/client/cmd/logdog_butler/main.go
diff --git a/logdog/client/cmd/logdog_butler/main.go b/logdog/client/cmd/logdog_butler/main.go
index e457148c8cc65bad8640b25e06f922dcd828b223..3a53aeb5c3eb9de00e0ffcc0b1918756624c4aff 100644
--- a/logdog/client/cmd/logdog_butler/main.go
+++ b/logdog/client/cmd/logdog_butler/main.go
@@ -5,7 +5,6 @@
package main
import (
- "bytes"
"flag"
"fmt"
"net/http"
@@ -217,15 +216,8 @@ func logAnnotatedErr(ctx context.Context, err error, f string, args ...interface
return
}
- var buf bytes.Buffer
- st := errors.RenderStack(err)
- if _, derr := st.DumpTo(&buf); derr != nil {
- // This can't really fail, since we're rendering to a Buffer.
- panic(derr)
- }
-
nargs := make([]interface{}, len(args)+1)
- nargs[copy(nargs, args)] = buf.Bytes()
+ nargs[copy(nargs, args)] = strings.Join(errors.RenderStack(err), "\n")
if f == "" {
f = "Captured error stack:"
« no previous file with comments | « logdog/client/cli/subcommandQuery.go ('k') | logdog/client/cmd/logdog_butler/output_logdog.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698