- print stack info when goroutine panic.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user