v1.5.1 增强程序稳定性
This commit is contained in:
10
EdgeNode/internal/utils/kvstore/panic.go
Normal file
10
EdgeNode/internal/utils/kvstore/panic.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package kvstore
|
||||
|
||||
import "fmt"
|
||||
|
||||
func wrapRecoveredPanic(message string, panicErr any) error {
|
||||
if resultErr, ok := panicErr.(error); ok {
|
||||
return fmt.Errorf("%s: %w", message, resultErr)
|
||||
}
|
||||
return fmt.Errorf("%s: %v", message, panicErr)
|
||||
}
|
||||
Reference in New Issue
Block a user