From fadbfd83d9e7f7b00fcffdaf8532e006327c74ad Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 10 Jun 2020 12:37:01 -0700 Subject: Include panic message in log PiperOrigin-RevId: 315745386 --- pkg/p9/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/p9/server.go b/pkg/p9/server.go index fdfa83648..60cf94fa1 100644 --- a/pkg/p9/server.go +++ b/pkg/p9/server.go @@ -482,10 +482,10 @@ func (cs *connState) handle(m message) (r message) { defer func() { if r == nil { // Don't allow a panic to propagate. - recover() + err := recover() // Include a useful log message. - log.Warningf("panic in handler: %s", debug.Stack()) + log.Warningf("panic in handler: %v\n%s", err, debug.Stack()) // Wrap in an EFAULT error; we don't really have a // better way to describe this kind of error. It will -- cgit v1.2.3