catch

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package catch runs functions and returns panic values as errors instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Try

func Try[Result any](fn func() Result) (result Result, err error)

Try runs fn and returns the result. If fn panicked, the panic value is returned as an error instead.

func TrySideEffect

func TrySideEffect(fn func()) (err error)

TrySideEffect is like Try, but does not have a return value.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL