initial import
This commit is contained in:
13
core/rescue/recover.go
Normal file
13
core/rescue/recover.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package rescue
|
||||
|
||||
import "zero/core/logx"
|
||||
|
||||
func Recover(cleanups ...func()) {
|
||||
for _, cleanup := range cleanups {
|
||||
cleanup()
|
||||
}
|
||||
|
||||
if p := recover(); p != nil {
|
||||
logx.ErrorStack(p)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user