15 lines
204 B
Go
15 lines
204 B
Go
|
package util
|
||
|
|
||
|
import (
|
||
|
"runtime/debug"
|
||
|
|
||
|
"github.com/golang/glog"
|
||
|
)
|
||
|
|
||
|
// panic 恢复.
|
||
|
func Recover() {
|
||
|
if re := recover(); re != nil {
|
||
|
glog.Errorf("PANIC RECOVERED:\n %v, %s", re, debug.Stack())
|
||
|
}
|
||
|
}
|