go-zero/core/rescue/recover.go
2020-08-08 16:40:10 +08:00

14 lines
208 B
Go

package rescue
import "github.com/tal-tech/go-zero/core/logx"
func Recover(cleanups ...func()) {
for _, cleanup := range cleanups {
cleanup()
}
if p := recover(); p != nil {
logx.ErrorStack(p)
}
}