resolvepanic moved to util.ResolvePanic
This commit is contained in:
parent
77101ac9b4
commit
0a74eadccb
6 changed files with 85 additions and 18 deletions
9
util/panic.go
Normal file
9
util/panic.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package util
|
||||
|
||||
// ResolvePanic convert panic recover to error This used
|
||||
// for map[any]any value manipulations when get panic
|
||||
func ResolvePanic(err *error) {
|
||||
if r := recover(); r != nil {
|
||||
*err = r.(error)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue