package errors

import "github.com/IBM/fp-go/errors"

Index

Variables

var IdentityError = F.Identity[error]

Functions

func As

func As[A error]() func(error) O.Option[A]

As tries to extract the error of desired type from the given error

func OnError

func OnError(msg string, args ...any) func(error) error

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

func OnNone(msg string, args ...any) func() error

OnNone generates a nullary function that produces a formatted error

func OnSome

func OnSome[T any](msg string, args ...any) func(T) error

OnSome generates a unary function that produces a formatted error

func ToString

func ToString(err error) string

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.