MCPcopy
hub / github.com/jesseduffield/lazygit / SafeWithError

Function SafeWithError

pkg/utils/utils.go:72–85  ·  view source on GitHub ↗
(f func() error)

Source from the content-addressed store, hash-verified

70}
71
72func SafeWithError(f func() error) error {
73 panicking := true
74 defer func() {
75 if panicking && gocui.Screen != nil {
76 gocui.Screen.Fini()
77 }
78 }()
79
80 err := f()
81
82 panicking = false
83
84 return err
85}
86
87func StackTrace() string {
88 buf := make([]byte, 10000)

Callers 2

RunAndHandleErrorMethod · 0.92
SafeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected