mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 17:20:24 +08:00
14 lines
185 B
Go
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)
|
|
}
|
|
}
|