vendor: update all dependencies
This commit is contained in:
parent
3f0789e2db
commit
08021c4636
2474 changed files with 435818 additions and 282709 deletions
16
vendor/github.com/pengsrc/go-shared/utils/recover.go
generated
vendored
Normal file
16
vendor/github.com/pengsrc/go-shared/utils/recover.go
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"context"
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/pengsrc/go-shared/log"
|
||||
)
|
||||
|
||||
// Recover is a utils that recovers from panics, logs the panic (and a
|
||||
// backtrace) for functions in goroutine.
|
||||
func Recover(ctx context.Context) {
|
||||
if x := recover(); x != nil {
|
||||
log.Errorf(ctx, "Caught panic: %v, Trace: %s", x, debug.Stack())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue