mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
753 B
753 B
name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
| name | slug | sourceRef | category | subCategory | playUrl | variantHelpers | similarHelpers | position | signatures | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TryCatch | trycatch | errors.go#L335 | core | error-handling | https://go.dev/play/p/PnOON-EqBiU |
|
|
50 |
|
Calls the catch function when the callback errors or panics.
caught := false
lo.TryCatch(func() error { panic("error") }, func() { caught = true })
// caught == true