package errors
import "github.com/IBM/fp-go/errors"
Index ¶
- Variables
- func As[A error]() func(error) O.Option[A]
- func OnError(msg string, args ...any) func(error) error
- func OnNone(msg string, args ...any) func() error
- func OnSome[T any](msg string, args ...any) func(T) error
- func ToString(err error) string
Variables ¶
Functions ¶
func As ¶
As tries to extract the error of desired type from the given error
func OnError ¶
OnError generates a unary function that produces a formatted error. The argument to that function is the root cause of the error and the message will be augmented with a format string containing %w
func OnNone ¶
OnNone generates a nullary function that produces a formatted error
func OnSome ¶
OnSome generates a unary function that produces a formatted error
func ToString ¶
ToString converts an error to a string
Source Files ¶
conv.go identity.go messages.go
- Version
- v1.0.151 (latest)
- Published
- Nov 23, 2024
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 4 months ago –
Tools for package owners.