From b95fa4807e3e8639f3894cb3c5c6a43cb0e9cb5d Mon Sep 17 00:00:00 2001 From: Jaana Burcu Dogan Date: Tue, 3 Jan 2017 00:56:44 -0800 Subject: [PATCH] handle error if CPU profile cannot start --- agent/agent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/agent.go b/agent/agent.go index d7951f58..7f338c84 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -183,7 +183,7 @@ func handle(conn net.Conn, msg []byte) error { pprof.Lookup("heap").WriteTo(conn, 0) case signal.CPUProfile: if err := pprof.StartCPUProfile(conn); err != nil { - return nil + return err } time.Sleep(30 * time.Second) pprof.StopCPUProfile()