- print stack info when goroutine panic.

This commit is contained in:
gazebo
2018-07-18 23:22:03 +08:00
parent c787714293
commit 98e5930534

View File

@@ -4,6 +4,7 @@ import (
"crypto/md5"
"encoding/binary"
"fmt"
"runtime/debug"
)
const (
@@ -46,6 +47,7 @@ func callHandler(handler func()) (retVal interface{}) {
defer func() {
if r := recover(); r != nil {
retVal = r
debug.PrintStack()
}
}()
handler()