Skip to content

Commit

Permalink
internal/lsp: add additional information when logging errors
Browse files Browse the repository at this point in the history
Fixes golang/go#33499

This logs additional information compatible with `golang.org/x/xerrors` like the frames.

Change-Id: If25c3979cf294dbe55b0e3d9d999b24c1ff8900d
GitHub-Last-Rev: 210fa40
GitHub-Pull-Request: #144
Reviewed-on: https://go-review.googlesource.com/c/tools/+/189344
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
jan-xyz authored and stamblerre committed Aug 26, 2019
1 parent 0772270 commit 11cc3c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/telemetry/event.go
Expand Up @@ -22,7 +22,11 @@ func (e Event) Format(f fmt.State, r rune) {
}
fmt.Fprint(f, e.Message)
if e.Error != nil {
fmt.Fprintf(f, ": %v", e.Error)
if f.Flag('+') {
fmt.Fprintf(f, ": %+v", e.Error)
} else {
fmt.Fprintf(f, ": %v", e.Error)
}
}
for _, tag := range e.Tags {
fmt.Fprintf(f, "\n\t%v = %v", tag.Key, tag.Value)
Expand Down

0 comments on commit 11cc3c1

Please sign in to comment.