MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / safeCall

Function safeCall

internal/bootstrap/patch.go:14–22  ·  view source on GitHub ↗
(v string, i int, f func())

Source from the content-addressed store, hash-verified

12var LastLaunchedVersion = ""
13
14func safeCall(v string, i int, f func()) {
15 defer func() {
16 if r := recover(); r != nil {
17 utils.Log.Errorf("Recovered from patch (version: %s, index: %d) panic: %v", v, i, r)
18 }
19 }()
20
21 f()
22}
23
24func getVersion(v string) (major, minor, patchNum int, err error) {
25 _, err = fmt.Sscanf(v, "v%d.%d.%d", &major, &minor, &patchNum)

Callers 1

InitUpgradePatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected