/PanicGuard

Go Package to safely call a function which may panic. The returned error can then be handled gracefully.

Primary LanguageGoMIT LicenseMIT

PanicGuard

Go Package to safely call a function which may panic. The returned error can then be handled gracefully.

Usage

str, err := preventpanic.RunWithReturn[string](func() string {
    xraysegment.AddAnnotation("token", token)
    return "Hello World"
})

err := preventpanic.Run(func() {
    xraysegment.AddAnnotation("token", token)
})