Back to Lo

Core Trycatchwitherrorvalue

docs/data/core-trycatchwitherrorvalue.md

1.53.0222 B
Original Source

Calls the catch function with the error value when the callback errors or panics.

go
lo.TryCatchWithErrorValue(
    func() error {
        panic("error")
    },
    func(val any) {
        fmt.Println(val)
    },
)