Try¶
func Try(fn func() error) (err error)
Try executes a function and returns its error. This is useful for defer statements or cleanup operations where you want to capture errors. Recovers from panics and converts them to errors.
func Try(fn func() error) (err error)
Try executes a function and returns its error. This is useful for defer statements or cleanup operations where you want to capture errors. Recovers from panics and converts them to errors.