go-zero/core/rescue/recover.go
2020-07-26 17:09:05 +08:00

14 lines
185 B
Go

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